P_registerCallback
Registers API callback to your system.
This mutation requires that your domain ownership is validated. Please read below on that.
Supported arguments
The following arguments are supported by P_registerCallback mutation:
Field | Type | Description |
---|---|---|
input | P_API_RegisterCallbackInput! | Callback URL and Type |
Return type
The mutation returns theP_API_RegisterCallbackResponse
type.
Example usage
Mutation
Here we are registering the DECLARED_STOCK_RESERVATION
API callback,
it will call the given url
, and will send Authorization: Bearer
header with the provided authorization
value.
mutation {
P_registerCallback(
input: {
type: DECLARED_STOCK_RESERVATION
url: "https://my-domain.com/eneba-callback"
authorization: "eW91ci1hdXRob3JpemF0aW9uLWhlYWRlcg=="
}
) {
success
}
}
Constraints for the url
field
- Domain ownership is validated
- Url must not be IP address
- Maximum length of url is 1024 characters
- Url must not contain query strings
- Url must use "secure http" (https://) scheme
Valid urls
- https://www.yourdomain.com/reservation
- https://yourdomain.com/reservation
- https://yourdomain.com
- https://reservation.yourdomain.com/
Invalid urls
- http://www.yourdomain.com/reservation - does not use https
- https://0.0.0.0/reservation - is IP address
- https://www.yourdomain.com/api?action=reservation - contains query strings
Constraints for the authorization
field
- Maximum length of url is 1024 characters on
production
and 255 onsandbox
.
Result
If domain ownership validation is successful, then we will receive a success
.
{
"data": {
"P_registerCallback": {
"success": true
}
}
}
Domain ownership validation
To prevent potential security issues, we need to verify that you are the owner of the domain you provide while registering the API callback. It will attempt to validate your domain ownership before making any API callback request.
Get the verification value
Navigate to Eneba dashboard and find the Domain verification menu.
Domain ownership can be proven in two ways:
- Dns TXT record validation
- Hosted file validation
DNS TXT record validation
DNS TXT record validation is the preferred validation mechanism as it is faster and does not make requests to your system meaning less load for your servers.
- Copy the TXT record value from the Eneba dashboard above
- Add this value into your DNS provider configuration as TXT record
- Hit the "Verify" button on your dashboard
Hosted file validation
Eneba will attempt to get the eneba-verification.txt
file from your domain before making any API callback request.
- Download the file from the Eneba dashboard above
- Upload it directly to your domain. It must be available at
https://yourdomain.com/eneba-verification.txt
- Hit the "Verify" button on your dashboard
If validation is successful, you now may register your API callbacks.