Callback (Webhook)
Viber Messaging status notifications
Callbacks are notifications that you 've asked Routee to send back to you when the status of your Viber campaign's messages change.
Viber Messaging Callbacks
Your callback service will receive a POST HTTP request with the following request body for an individual message progress of the Viber campaign:
{
"trackingId": "string",
"campaignTrackingId": "string",
"to": "string",
"from": "string",
"groups": ["string"],
"country": "string",
"status": {
"name": "string",
"reason": {
"detailedStatus": "string",
"description": "string"
},
"updatedDate": "string"
},
"body": {
"text": "string",
"imageURL": "string",
"viberAction": {
"caption": "string",
"targetUrl": "string"
}
},
"ttl": integer,
"label":"label of campaign",
"inboundUrl": "string",
"applicationName": "string",
"price": double,
"direction": "string",
"originatingService": "Viber",
"createdAt": "string"
}| KEY | DESCRIPTION |
|---|---|
| trackingId | The tracking Id of the Viber message. |
| campaignTrackingId | The tracking Id of the Viber campaign. |
| to | The recipient of the Viber message. |
| from | The senderId of the Viber message. |
| groups | All contact groups (tags) that this contact belongs to. |
| status.name | The status name of the Viber message. |
| status.reason | The reason of the status. |
| status.reason.detailedStatus | The detailed status. |
| status.reason.description | The description of the detailed status. |
| status.updatedDate | The date of the last status change of the Viber message. |
| body.text | The text of Viber message. |
| body.iosFallbackText | Alternative message that will be sent after TTL range expiration. |
| body.imageURL | The url of the image. |
| body.viberAction.caption | The displayed text on the button. |
| body.viberAction.targetUrl | The target URL of the Viber action. |
| body.viberFile | Represents the file of the viber message. |
| body.viberFile.fileName | File name of the viber message. |
| body.viberFile.fileType | File type of the viber message. |
| body.viberFile.fileUrl | The Url of the of the viber message file. (recommended file size: 600KB for optimal delivery) |
| ttl | Time range until message expires. TTL range in seconds: 30 - 86400 seconds. If it is not set, the default range is 14 days. TTL range in seconds for web clients: 300 - 86400 seconds. |
| label | A generic label using for tagging the viber campaign. |
| inboundUrl | The defined callback URL that will receive the inbound messages. Check here for details. |
| applicationName | The name of the application that was used to send this Viber message. |
| price | The cost of the Viber message. |
| direction | The direction of the Viber message. |
| originatingService | The service that sent this Viber message. |
Callback retry policy
Your endpoint must respond with HTTP 200 OK within 2 seconds. Otherwise Routee closes the connection and retries (up to 12 attempts over 24 hours).
| Attempt | Delay after previous try |
|---|---|
| 1st | 30 sec |
| 2nd | 1 min |
| 3rd | 2 min |
| 4th | 5 min |
| 5th | 10 min |
| 6th | 15 min |
| 7th | 30 min |
| 8th | 1 hour |
| 9th | 2 hours |
| 10th | 4 hours |
| 11th | 8 hours |
| 12th | 24 hours |
Design your handler to be idempotent — the same event may be delivered more than once.
Secure your endpoint — Serve callbacks over HTTPS and include a hard-to-guess secret in the callback URL path or query string. Validate it on every request.
Related
Updated 23 days ago

