Use this method to set callback URL values.
set Method
As a result of a completed request using the set
method, a callback value will be set. If the request is successful, the server returns the code 200
. If the request fails, the server returns a response with an error code.
If the code 200
is not received in response to the callback request, edna Pulse makes 10 more request attempts with an interval of 2*X seconds between attempts (where X is the number of attempts) until the code 200
is received in response. That is, every 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 seconds.
URL
To set a required callback value, send a POST request to the following URL address: https://app.edna.io/api/callback/set.
Request Format
A JSON object is passed in the request body with the parameters shown below.
{ "statusCallbackUrl": "https://messagesxxx.com/status/webhook", "inMessageCallbackUrl": "https://messagesxxx.com/messages/webhook", "subjectId": 234 }
Parameter | Data type | Description |
statusCallbackUrl | string (optional) | Callback URL for message delivery statuses, 500 characters max. Important! The URL address you specify must exist and be available for a request from the public Internet. To verify its availability, we will send a HEAD request, to which a response with the status 200 is expected. Otherwise, we won’t be able to register this callback URL. |
inMessageCallbackUrl | string (optional) | Callback URL for incoming messages, 500 characters max. Important! The URL address you specify must exist and be available for a request from the public Internet. To verify its availability, we will send a HEAD request, to which a response with the status 200 is expected. Otherwise, we won’t be able to register this callback URL. |
messageMatcherCallbackUrl | string (optional) | Callback URL for managing API (e.g. template registration), 500 characters max. Important! The URL address you specify must exist and be available for a request from the public Internet. To verify its availability, we will send a HEAD request, to which a response with the status 200 is expected. Otherwise, we won’t be able to register this callback URL. |
subjectId | integer (optional) | Channel identifier. You can learn this value using the method that retrieves the list of channels. |
subjectId
is not specified in the request, the callback URLs are set for all channels of the tenant. If subjectId
is specified, then the callback URLs are only set for that channel. Response Format
As a response to the request, a JSON object that contains the response code is returned.
Parameter | Data type | Description |
code | string | Request response code |
Request Response Codes
Code | Description |
ok | The request has been completed successfully. |
error-callback-url-max-length | The URL address contains more than 500 characters. |
error-callback-url-not-https | The URL address does not use HTTPS. |
error-callback-url-not-available | The HEAD request to the specified URL has failed. |
error-subject-unknown | The channel with the specified subjectId has not been found. |
url-not-specified | StatusCallbackUrl or inMessageCallbackUrl must be specified. |