Setting URLs for Webhooks
The api/callback/set method is used to set the webhook URL. There are two types of webhooks available in edna Pulse: master and additional.
If necessary, you can enable webhook authentication in your edna Pulse account.
Managing edna Pulse WebhooksCalling the method
To set the URL for the webhook, send a POST request to the URL https://app.edna.io/api/callback/set.
To verify the availability of the URL, edna Pulse will send a test HEAD request and expect a response with code 200. If the HEAD request fails, the specified URL will not be saved.
If a webhook delivery fails, edna Pulse will attempt to resend it up to three times using a backoff scheme: 4, 128, and 2048 seconds after the previous attempt.
Request format
{
"statusCallbackUrls": [
"string"
],
"inMessageCallbackUrls": [
"string"
],
"messageMatcherCallbackUrls": [
"string"
],
"messageMatcherCategoryChangedCallbackUrls": [
"string"
],
"shortLinkVisitedCallbackUrls": [
"string"
],
"subjectIds": [
"number"
]
}
Request example
Configuring master webhooks
{
"statusCallbackUrls": [
"https://messagesxxx.com/status/webhook/statusCallbackUrls"
],
"inMessageCallbackUrls": [
"https://messagesxxx.com/status/webhook/inMessageCallbackUrls"
],
"messageMatcherCallbackUrls": [
"https://messagesxxx.com/status/webhook/messageMatcherCallbackUrls"
],
"messageMatcherCategoryChangedCallbackUrls": [
"https://messagesxxx.com/status/webhook/messageMatcherCategoryChangedCallbackUrls"
],
"shortLinkVisitedCallbackUrls": [
"https://messagesxxx.com/status/webhook/shortLinkVisitedCallbackUrls"
]
}
Configuring additional webhooks
The maximum number of URLs for each type of event within a single channel is 2.
{
"statusCallbackUrls": [
"https://messagesxxx.com/webhook/statusCallbackUrls/1",
"https://messagesxxx.com/webhook/statusCallbackUrls/2"
],
"inMessageCallbackUrls": [
"https://messagesxxx.com/webhook/inMessageCallbackUrls/1"
],
"messageMatcherCallbackUrls": [
"https://messagesxxx.com/webhook/messageMatcherCallbackUrls/1"
],
"messageMatcherCategoryChangedCallbackUrls": [
"https://messagesxxx.com/webhook/messageMatcherCategoryChangedCallbackUrls/1",
"https://messagesxxx.com/webhook/messageMatcherCategoryChangedCallbackUrls/2"
],
"shortLinkVisitedCallbackUrls": [
"https://messagesxxx.com/webhook/shortLinkVisitedCallbackUrls/1"
],
"subjectIds": [
1
]
}
Request parameters
Your URL should be genuine and accessible to the public via the Internet. Only use the secure HTTPS protocol — the default is TCP port 443. URLs can contain a maximum of 500 characters.
| Parameter | Data type | Character | Description |
statusCallbackUrls | array of strings | Optional | A list of URLs to which webhooks about the message delivery status will be sent. |
inMessageCallbackUrls | array of strings | Optional | A list of URLs to which webhooks about incoming messages will be sent. |
messageMatcherCallbackUrls | array of strings | Optional | A list of URLs that will receive webhooks about the registration status of the template. |
messageMatcherCategoryChangedCallbackUrls | array of strings | Required | The link to the newsletter is the address where you want to download webpages from another WhatsApp directory. |
shortLinkVisitedCallbackUrls | array of strings | Required | The URL of the message where you can find messages for tracking link clicks from your WhatsApp. |
object identifiers | array of numbers | Required | The message and the ID of the users for whom it is not possible to set the URL for additional websites.
To find out the channel ID, use the API method to get information about channels — the If you do not specify |
If subjectIds is specified, the maximum number of URLs per event type within a single channel is 2.
If the SubjectID parameter is not specified, webhooks will be configured for all channels. If the SubjectID parameter is specified, the webhook URL will be set only for the channel with the specified ID.
Response format
{
"code": "string"
}
Response example
{
"code": "ok"
}
Response parameters
| Parameter | Data type | Description |
code | string | The response code to the request. |
Errors
| Code | Error | Description |
400 | callback-url-not-available | The URL is not available for a request from the public Internet. Possible comments:
|
400 | callback-url-not-https | The URL does not use HTTPS protocol. Possible comments:
|
400 | callback-url-too-long | The length of the URL is longer than allowed. Possible comments:
|
400 | subject-not-found | The channel with the specified ID was not found. Possible comments:
|
400 | url-not-specified | There is no URL for the webhook or the type of event that the webhook is configured for. Possible comments:
|