Webhooks
Webhooks enable your applications to receive real-time data on important interactions within your SlickText account. By providing a URL and selecting the events you want to track, you can receive detailed information whenever those events occur. Refer to the Setup section to start using webhooks.
The following webhook events are available...
Setup
To activate webhooks and set your POST URL, follow these steps:
- Log in to your SlickText account.
- Go to the "Settings" page.
- Select "API & Webhooks".
- Click on "Webhooks".
- Click "Create Webhook".
- Optionally, provide a name and description for your webhook.
- Enter your POST URL in the "URL" field.
- Toggle the "active" switch to enable the webhook.
- Select the events you want to receive by checking the corresponding boxes.
- Click "Save" to apply your settings.
To view the details of webhook events, navigate to the Webhook page and click the "View Event Log"
On the Webhook Events page, you can troubleshoot issues and review event payloads from the past 30 days. Each triggered webhook event includes details such as the event name, status, number of attempts, and the date and time it occurred. Click on individual events to view more detailed information.
If the initial webhook request fails, six additional attempts will be made. Each webhook request has a 5-second timeout, and your application is expected to respond within this timeframe. If it does not, the request will be considered a failure.
Each webhook request includes an attempt and last response code property in the webhook details. These properties are useful for identifying reattempts of failed initial requests and understanding their respective response codes.
The schedule for webhook attempts is outlined below...
REQUEST | TIMING |
---|---|
Initial Attempt | Immediately. |
Second Attempt | 1 minute after the initial attempt. |
Third Attempt | 1 hour after the second attempt. |
Fourth Attempt | 1 day after the third attempt. |
Fifth Attempt | 2 days after the fourth attempt. |
Sixth Attempt | 4 days after the fifth attempt. |
Seventh Attempt | 7 days after the sixth attempt. |
To ensure the security of your webhook endpoint, you may want to verify that requests are genuinely coming from SlickText.
Although this step is optional, it is highly recommended to prevent unauthorized data submissions to your service.
Instead of whitelisting SlickText IP addresses, which can change over time and potentially block legitimate requests, we recommend using a webhook secret for validation.
When you create a webhook, a unique "webhook secret" token is generated. This token is used to create a hash signature for each POST request. You can find your webhook secret on the webhook settings page.
Each POST request from SlickText includes an x-slicktext-signature header, which contains an HMAC digest of the request payload. This digest is generated using the MD5 hashing algorithm and your webhook secret as the key. To verify the request, compute the HMAC digest of the payload using the same method and compare it to the x-slicktext-signature header value. If they match, the request is authentic.
Contact Created
The "contact created" event is a webhook event that is triggered whenever a new contact is created in your brand. This event will happen when a contact is created through the following circumstances…
- Manually
- Imported
- API Created
- Popup
- Landing Page
- Inbox
- Keyword
- Integration
Example Response:
Below is an example of the JSON data you'd receive from the "Contact Created" event.
{
"id": "6744a297616039e17200b0d2",
"name": "contact_created",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:15:19",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"mobile_number": "+17165551212",
"opt_in_status": "subscribed",
"source": "Keyword",
"_source_id": 1,
"state": "NY",
"country": "US",
"last_opt_in_status_change": "2024-11-25 16:15:19",
"created": "2024-11-25 16:15:19"
}
}
Contact Edited
The "Contact Edited" event is a webhook event that is triggered whenever a contact’s data is edited. This event will happen when a contact is updated through the following circumstances…
- Import
- Manually
- Workflow Automation
- Inbox
- API
- Integration
Example Response:
Below is an example of the JSON data you'd receive from the "Contact Updated" event.
{
"id": "6744a1384b188dc8960e2132",
"name": "contact_updated",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:09:28",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"first_name": "Web",
"last_name": "Hook",
"mobile_number": "+17165551212",
"mobile_number_carrier": null,
"email": null,
"birthdate": "null",
"address": null,
"city": null,
"state": "NY",
"zip": null,
"country": "US",
"source": "manual",
"_source_id": null,
"sub_source": null,
"_sub_source_id": null,
"custom_fields": null,
"timezone": null,
"language": null,
"opt_in_status": "subscribed",
"last_opt_in_status_change": "2024-11-25 15:52:21",
"created": "2024-11-25 15:52:21",
"last_updated": "2024-11-25 16:09:28"
}
}
Contact Deleted
The "Contact Deleted" event is a webhook event that is triggered whenever a contact is deleted from your brand. This event will happen when a contact is deleted through the following circumstances…
- Manually
- API
- Workflow automation
Example Response:
Below is an example of the JSON data you'd receive from the "Contact Deleted" event.
{
"id": "6744a1f6a86be47646017662",
"name": "contact_deleted",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:12:38",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"first_name": "Web",
"last_name": "Hook",
"mobile_number": "+18145551234",
"mobile_number_carrier": null,
"email": null,
"birthdate": "null",
"address": null,
"city": null,
"state": "NY",
"zip": null,
"country": "US",
"source": "manual",
"_source_id": null,
"sub_source": null,
"_sub_source_id": null,
"custom_fields": {
"custom_date": "2024-12-25"
},
"timezone": null,
"language": null,
"opt_in_status": "subscribed",
"last_opt_in_status_change": "2024-11-25 15:52:21",
"created": "2024-11-25 15:52:21",
"last_updated": "2024-11-25 16:10:31"
}
}
Campaign Sent
The "campaign sent" event is a webhook event that is triggered whenever a new campaign is sent by your brand.
Example Response:
Below is an example of the JSON data you'd receive from the "Campaign Sent" event.
{
"id": "6744a231d00e6ad75c0e8b94",
"name": "campaign_sent",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:13:37",
"data": {
"campaign_id": 10000,
"_brand_id": 123456789,
"_created_by_user_id": 333333,
"name": "Black Friday Sale",
"body": "Stop by and get 20% off!",
"media_url": null,
"audience_size": 1000,
"status": "sent",
"status_detail": null,
"status_date": "2024-11-25 16:13:37",
"completion_percentage": 100,
"created": "2024-11-25 16:13:36",
"scheduled": null,
"started": "2024-11-25 16:13:36",
"finished": "2024-11-25 16:13:37",
"last_updated": "2024-11-25 16:13:37"
}
}
Campaign Failed
The "Campaign Failed" event is a webhook event that is triggered whenever a campaign fails.
Example Response:
Below is an example of the JSON data you'd receive from the "Campaign Failed" event.
{
"id": "6769946cd00c3a257304e8d2",
"name": "campaign_failed",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-12-23 16:48:44",
"data": {
"campaign_id": 1111,
"_brand_id": 123456789,
"_created_by_user_id": 3333,
"name": "Black Friday Sale",
"body": "Stop by and get 20% off!",
"media_url": null,
"audience_size": 1000,
"status": "failed",
"status_detail": "This campaign has already been attempted.",
"status_date": "2024-12-23 16:48:44",
"completion_percentage": 0,
"created": "2024-11-25 16:13:36",
"scheduled": null,
"started": "2024-11-25 16:13:36",
"finished": "2024-11-25 16:13:37",
"last_updated": "2024-11-25 16:13:37"
}
}
Inbox Message Received
The "Inbox Chat Message Received" event is a webhook event that is triggered whenever you receive a new message in your inbox.
Example Response:
Below is an example of the JSON data you'd receive from the "Inbox Chat Message Received" event.
{
"id": "6744a2bb587c8f2cf402878b",
"name": "inbox_message_received",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:15:55",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"status": "open",
"unread": 1,
"_last_message_id": "6744a2ba97274144ab0cc232",
"last_message": "What time do you open?",
"last_message_direction": "incoming",
"last_message_sent": "2024-11-25 16:15:54",
"_assigned_to_user_id": 3333,
"created": "2024-11-25 16:15:54",
"_id": "6744a2ba587c8f2cf4028786"
}
}
Inbox Conversation Status Changed
The "Inbox Conversation Status Changed" event is a webhook event that is triggered whenever the status of the inbox conversation is updated. The following status would trigger the event…
- Open
- Pending
- Closed
Example Response:
Below is an example of the JSON data you'd receive from the "Inbox Conversation Status Changed" event.
{
"id": "6744a2bb587c8f2cf4028788",
"name": "inbox_thread_status_changed",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:15:55",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"status": "open",
"unread": 1,
"_last_message_id": "6744a2ba97274144ab0cc232",
"last_message": "What time do you open?",
"last_message_direction": "incoming",
"last_message_sent": "2024-11-25 16:15:54",
"_assigned_to_user_id": 3333,
"created": "2024-11-25 16:15:54",
"_id": "6744a2ba587c8f2cf4028786"
}
}
Inbox Conversation Assignee Changed
The "Inbox Conversation Assignee Changed" event is a webhook event that is triggered whenever the conversation’s assignment changes. This happens when the conversation is assigned to…
- Teammate from a Teammate
- Teammate from Unassigned
- Unassigned from Teammate
Example Response:
Below is an example of the JSON data you'd receive from the "Inbox Conversation Assignee Changed" event.
{
"id": "6744a2bb587c8f2cf4028788",
"name": "inbox_thread_assignee_changed",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:15:55",
"data": {
"contact_id": 1111111,
"_brand_id": 123456789,
"status": "open",
"unread": 1,
"_last_message_id": "6744a2ba97274144ab0cc232",
"last_message": "What time do you open?",
"last_message_direction": "incoming",
"last_message_sent": "2024-11-25 16:15:54",
"_assigned_to_user_id": 2222,
"created": "2024-11-25 16:15:54",
"_id": "6744a2ba587c8f2cf4028786"
}
}
Inbox Conversation Tags Changed
The "Inbox Conversation Tags Changed" event is a webhook event that is triggered whenever a conversation’s Tag has changed.
Example Response:
Below is an example of the JSON data you'd receive from the "Inbox Conversation Tags Changed" event.
{
"id": "6744a36f6fa0c1ed2b0acda7",
"name": "inbox_thread_tags_changed",
"url": "https://yourwebsite.com/webhooklistener",
"attempts": 1,
"date": "2024-11-25 16:18:55",
"data": {
"_id": "6744a2ba587c8f2cf4028786",
"contact_id": 1111111,
"_brand_id": 123456789,
"status": "open",
"_last_message_id": "6744a2ba97274144ab0cc232",
"last_message": "What time do you open?",
"last_message_direction": "incoming",
"last_message_sent": "2024-11-25 16:15:54",
"_assigned_to_user_id": 3,
"created": "2024-11-25 16:15:54",
"updated": "2024-11-25 16:18:55",
"_inbox_tag_ids": [
4
]
}
}