Setting Up Callback URLs
The SET API method sets the URLs to which edna Pulse will send callback requests.
The SET method accepts only POST requests. The parameters are passed in the request body as a JSON object. An API key is used for authorization. After registering with edna Pulse, you can generate or copy the existing key yourself.
Specifying Settings for APIYou can enable authorization of callback requests that edna Pulse transmits to your server.
Method call
Send a POST request to the URL https://app.edna.io/api/callback/set
In response to a request from the server, the status of its execution with the code 200
should be returned.
If the code 200
does not arrive in response to the callback request, edna Pulse performs 10 more request attempts with an interval of 2 seconds between attempts (where X is the attempt number) until the code 200
arrives in response.
That is, every 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 seconds.
Request Body Format
{
"statusCallbackUrl": "https://messagesxxx.com/status/webhook",
"inMessageCallbackUrl": "https://messagesxxx.com/messages/webhook",
"subjectId": 234
}
Request Parameters
The URL specified in the statusCallbackUrl
, inMessageCallbackUrl
and messageMatcherCallbackUrl
parameters must exist and be available for request from the public Internet. To check availability, we will send a HEAD request, to which we expect to see a response with the status 200.
Otherwise, we will not be able to register your URL.
Parameter | Data type | Description |
---|---|---|
statusCallbackUrl | string (optional) | The URL of the callback for receiving message delivery statuses. 500 characters maximum. |
inMessageCallbackUrl | string (optional) | The URL of the callback for receiving incoming messages. 500 characters maximum. |
messageMatcherCallbackUrl | string (optional) | The URL of the callback for receiving management events (for example, template registration). |
subjectId | integer (optional) | The channel ID. It can be found through the channel list method. Receiving List of Channels |
If the subjectID
parameter is not specified in the request, then callbacks are set for all tenant channels.
If the subjectID
is specified in the request, the value of the callback address is set only for the specified channel.
Response format
A JSON object containing the request execution code is returned in response to the request.
Parameter | Data type | Description |
---|---|---|
code | string | Response code. |
Request response codes
Code | Description |
---|---|
ok | The request was successfully completed. |
error-callback-url-max-length | The URL contains more than 500 characters. |
error-callback-url-not-https | The URL does not use https. |
error-callback-url-not-available | The HEAD request for the URL failed. |
error-subject-unknown | The channel with the specified ID was not found. |
url-not-specified | You must specify StatusCallbackUrl or inMessageCallbackUrl . |