Creating Delivery Webhooks
A Delivery Webhook is nothing but an Allowlist URL that can receive updates from Fyno regarding the delivery status of the notifications sent out and easily share the delivery details with you, to a location of your convenience, pre-decided by you.
An Allowlist URL can be converted anytime to a Delivery Webhook, once it is successfully verified by following the below steps:
- Navigate to the Allowlist page by clicking on the profile icon on the top right corner to open the menu and click on Workspace Settings ind "Allowlist URL" on the ribbon menu and click on it. On the page that loads, find the link you want to tag as the Delivery Webhook.
- If this Allowlist URL is not verified, follow the steps. Once verified, click on the "More" (three dots) menu on the right side to find the option Send DLR and click on it.
- In the window that opens, you can add additional configurations, based on your requirements. You can also alternatively scroll to the bottom and save. This will send you the basic details that are pre-configured at Fyno's end.
Once this is done, all the delivery statuses for every notification triggered will be automatically updated at this location.
Not all Providers and Channels give you delivery notifications and updates. Check here for a detailed list
Callback Objects in a Request
Parameter | Type and Value |
---|---|
enable | Default: true, true: enable delivery status over callback. false: disable delivery status over callback |
custom_id | string; an alpha-numeric unique identifier of your notification. Length: 100 characters |
custom1 | string; (Optional) additional information that you want to tag your notification. Example: order-id Length: 30 characters |
custom2 | string; (Optional) additional information that you want to tag your notification. Example: category Length: 30 characters |
{
"event": "YOUR_EVENT_NAME",
"to": { // you channel destination },
"data": { // your template placeholders },
"callback": {
"custom_id": "YOUR_CUSTOM_ID_VALUE",
}
}
Callback Response
Here's a list of default fields which will be sent if the delivery status callback is subscribed using Webhook URL" with "Callback Object" in the request:
The Delivery Webhook will be sent using:
Method: POST | GET
Content-Type : application/x-www-form-urlencoded | application/json
Data: Default Parameters + Additional Parameters
Default Parameters
Parameter Name | Type & Value |
---|---|
custom_id | String; an alpha-numeric unique identifier that is provided in the callback object during the submission request |
msg_id | String; Fyno message id that is generated during submission request. example : 17f7e491-f51f-4e1e-881c-794f838c7c3c:s8a5 |
status | String; It holds the delivery status information of the triggered message id. Example: DELIVERED, FAILED, READ, OPEN, etc |
Additional Paramters
Additional Parameters can be sent in the response by configuring the same in your "Delivery Webhook" URL. All you will need to do is configure it as a Placeholder as shown in the sample payload below.
This configuration needs to be done in the payload section when converting an Allowlist URL to a Delivery Webhook
Here is a sample payload for reference.
{
"param1": "{{destination}}",
"param2": "{{provider}}",
"param6": "{{integration_name}}",
…………
}
Below is a list of additional parameters that Fyno can send you as data points.
Parameter Name | Type & Value |
---|---|
request_id | string; request_id parameter in response which is generated during submission request example: 17f7e491-f51f-4e1e-881c-794f838c7c3c |
destination | string; Fyno message id that is generated during submission request. example : 17f7e491-f51f-4e1e-881c-794f838c7c3c:s8a5 |
message | string; This is an error message given by the provider if any delivery failure occurs. Note: all provider does not gives this information |
senttime | string; Submission time of the request, YYYY-MM-DD hh:mm:ss UTC |
dlrtime | string; Submission time of the request, YYYY-MM-DD hh:mm:ss UTC |
integration | string; Integration account name through which the notification was sent |
channel | string; name of the channel through which the notification was sent |
provider | string; name of the provider via which the notification was sent |
event | string; name of Event that is being triggered |
template | string; name of the Template, whose content is sent out delivery and ideally it is being configured in the event |
version | String: API version that is used to trigger an event test or live |
custom1 | String: custom1 value that is submitted callback object in submission request. If it does not pass in the request then it will be an empty string |
custom2 | String: custom2 value that is submitted callback object in submission request. If it does not pass in the request then it will be an empty string |
Sample Webhook Configuration and Response
Sample configuration for the additional parameters (JSON) in Webhooks Delivery status section
{
"url": "https://webhook.site/847c54cc-c471-40f4-b793-36c18a",
"method": "post",
"headers": {
"Content-Type": "application/json"
},
"data": {
"recipent": "{{destination}}",
"providername": "{{provider}}",
"message": "{{message}}",
"request_time": "{{senttime}}",
"delivery_time": "{{dlrtime}}",
"account_name": "{{integration_name}}",
"reference_msg_id": "{{custum_id}}",
"order_id": "{{custom1}}",
"category": "{{custom2}}",
"channel": "{{channel}}"
}
}
Once this is successfully configured, here is a sample for the Callback Response you would receive.
{
"msg_id": "FYNO_MSG_ID_UUID",
"status": "DELIVERED",
"custom_id": "YOUR_CUSTOM_ID_VALUE",
"recipent": "[email protected]",
"providername": "sendgrid",
"message": "",
"requesttime": "2023-03-24 10:23:39",
"deliverytime": "2023-03-24 10:23:50",
"account_name": "EmailProduction",
"reference_msg_id": "YOUR_CUSTOM_ID_VALUE",
"order_id": "YOUR_CUSTOM1_VALUE",
"category": "YOUR_CUSTOM2_VALUE",
"channel": "email"
}
Updated 6 months ago