Which information is sent as Webhook Payload?
- Getting Started
- Bot Building
- Smart Agent Chat
- Conversation Design
-
Developer Guides
Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration Microsoft Dynamics 365 Integration
- Deployment
- External Agent Tool Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
The Haptik Platform sends an event to your registered webhook under the below situations:
- Bot replies to a user message.
- An agent replies to a user message via our agent chat tool.
- Client integrates our API to send messages to a user.
The payload sent to your registered webhook will always be in JSON.
Parameters
Property Name |
Description |
---|---|
version |
Webhook version |
timestamp |
ISO timestamp denoting when the webhook request was created in the haptik system |
user |
All user info will be available here |
user.auth_id |
This is an alphanumeric user identifier from your system. |
business_id |
Business id is a unique numeric identifier for your business, provided by Haptik. |
event_name |
Possible Values: message, chat_pinned and chat_complete. |
agent |
All agent info will be available here |
agent.id |
Unique identifier for the agent. |
agent.name |
Name of the agent or bot who sent the message. Gogo is an internal name for our ai engine. |
agent.profile_image |
URL for the agent profile image. |
agent.is_automated |
Whether the reply was automated or not. It will be false if agent sent the reply |
agent.email |
Email address of the agent, it will be null if event is automated. |
message |
All message info will be available here |
message.id |
Unique numeric identifier for messages |
message.body |
Will comprize of HSL elements. For a complete description of HSL elements refer here
|
Payload Types
Message
event_name = message
Message sent by an agent or a bot.
Example:
{
"version": "1.0",
"timestamp": "2018-10-04T12:41:27.980Z",
"user": {
"auth_id": "<AUTH_ID>",
"device_platform": "<DEVICE_PLATFORM>",
"device_platform_name": "<DEVICE_PLATFORM_NAME>",
"user_name": "<USER_NAME>",
"user_id": "<USER_ID>",
"phone_model": "<PHONE_MODEL>",
"os_version": "<OS_VERSION>",
"package_name": "<PACKAGE_NAME>",
},
"business_id": 343,
"business_name": "<BUSINESS_NAME>",
"event_name": "message",
"agent": {
"id": 4415,
"name": "gogo",
"profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg",
"is_automated": true,
"email": null
},
"message": {
"id": 1982371,
"body": {
"text": "Hi",
"type": "TEXT",
"data": {
"quick_replies": []
}
}
}
}
Chat Pinned
event_name = chat_pinned
A chat has been assigned to an agent.
Example:
{
"version": "1.0",
"timestamp": "2018-10-04T12:41:27.980Z",
"user": {
"auth_id": "<AUTH_ID>",
"device_platform": "<DEVICE_PLATFORM>",
"device_platform_name": "<DEVICE_PLATFORM_NAME>",
"user_name": "<USER_NAME>",
"user_id": "<USER_ID>",
"phone_model": "<PHONE_MODEL>",
"os_version": "<OS_VERSION>",
"package_name": "<PACKAGE_NAME>",
},
"business_id": 343,
"business_name": "<BUSINESS_NAME>",
"event_name": "chat_pinned",
"agent": {
"id": 235,
"name": "Prateek",
"profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg",
"is_automated": false,
"email": "prateek@gmail.com"
},
"message": {
"id": 1982314,
"body": {
"text": "Prateek has entered the Conversation",
"type": "SYSTEM",
"data": {
"event_name": "chat_pinned",
"payload": {
"profile_image": "<PROFILE_IMAGE_URL>",
"agent_name": "<AGENT_NAME>",
"team_name": "<TEAM_NAME>"
}
}
}
}
}
Chat Complete
event_name = chat_complete
A chat has been marked as complete by an agent from Smart Agent Chat.
Note: When a chat is marked complete any assigned agent is cleared.
Example:
{ "version": "1.0", "timestamp": "2018-10-04T12:41:27.980Z", "user": { "auth_id": "<AUTH_ID>", "device_platform": "<DEVICE_PLATFORM>", "device_platform_name": "<DEVICE_PLATFORM_NAME>", "user_name": "<USER_NAME>", "user_id": "<USER_ID>", "phone_model": "<PHONE_MODEL>", "os_version": "<OS_VERSION>", "package_name": "<PACKAGE_NAME>", }, "business_id": 343, "business_name": "<BUSINESS_NAME>", "event_name": "chat_complete", "agent": { "id": 4415, "name": "gogo", "profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg", "is_automated": true, "email": null }, "message": { "id": 1982471, "body": { "text": "The conversation has been completed", "type": "SYSTEM", "data": {} } } }
Webhook Conversation Complete
event_name = webhook_conversation_complete
Conversation has been marked complete by an agent or a bot.
Example:
{ "version": "1.0", "timestamp": "2019-07-03T11:42:44.077Z", "business_id": 343, "business_name": "<BUSINESS_NAME>", "event_name": "webhook_conversation_complete", "user": { "auth_id": "<AUTH_ID>", "device_platform": "<DEVICE_PLATFORM>", "device_platform_name": "<DEVICE_PLATFORM_NAME>", "user_name": "<USER_NAME>", "user_id": "<USER_ID>", "phone_model": "<PHONE_MODEL>", "os_version": "<OS_VERSION>", "package_name": "<PACKAGE_NAME>", }, "agent": { "id": 4415, "name": "gogo", "profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg", "is_automated": true, "email": null }, "follow_up_details": { // This dict will be empty when followup is not present "follow_up_timestamp": 1597668000, "send_to": 1, // 1/ 2 / 3, (Expert / User / Both) "expert_name": "expert", "comment": "follow up comment", "team_id": 2 }, "data": { "conversation_no": "<CONVERSATION_NO>", "collection_id": "<COLLECTION_ID>", "conversation_identifier": "<CONVERSATION_IDENTIFIER>", "chat_link":"<CHAT_LINK>", // deprecated. use `complete_chat_link` instead "complete_chat_link": "<CHAT_LINK>", "completion_type": "agent", // possible values 'gogo', 'agent', 'autocomplete' depends who marked the chat complete "completion_by": "<AGENT_CLAIM_NAME>", // the state of a conversation before it was marked as completed. //Possible values 'AGENT_CLAIM_NAME', 'Team Offline Flag', 'Waiting for User', 'Bot completed' "closing_categories": { "reason": "", "subReason": "", "comment": "" }, "conversation_details": { "insurance_no": "CDQP12324", "payment_mode": "COD" }, "user_details": { "phone_number": 8826755986, "date_of_birth": "21/07/1995" } } }
Webhook Agent Chat Close
event_name = webhook_agent_chat_close
The agent has marked the chat as closed from his end.
Example:
{ "version": "1.0", "timestamp": "2019-07-03T11:42:44.077Z", "business_id": 343, "business_name": "<BUSINESS_NAME>", "event_name": "webhook_agent_chat_close", "user": { "auth_id": "<AUTH_ID>", "device_platform": "<DEVICE_PLATFORM>", "device_platform_name": "<DEVICE_PLATFORM_NAME>", "user_name": "<USER_NAME>", "user_id": "<USER_ID>", "phone_model": "<PHONE_MODEL>", "os_version": "<OS_VERSION>", "package_name": "<PACKAGE_NAME>", }, "agent": { "id": 4415, "name": "gogo", "profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg", "is_automated": true, "email": null }, "follow_up_details": { // This dict will be empty when followup is not present "follow_up_timestamp": 1597668000, "send_to": 1, // 1/ 2 / 3, (Expert / User / Both) "expert_name": "expert", "comment": "follow up comment", "team_id": 2 }, "data": { "conversation_no": "<CONVERSATION_NO>", "collection_id": "<COLLECTION_ID>", "conversation_identifier": "<CONVERSATION_IDENTIFIER>", "chat_link":"<CHAT_LINK>", // deprecated. use `complete_chat_link` instead "complete_chat_link": "<CHAT_LINK>", "closing_categories": { "reason": "", "subReason": "", "comment": "" }, "conversation_details": { "insurance_no": "CDQP12324", "payment_mode": "COD" }, "user_details": { "phone_number": 8826755986, "date_of_birth": "21/07/1995" } } }
Webhook Conversation Inactivity
event_name = webhook_conversation_inactivity
The conversation has been inactive for greater than 8 minutes.
Example:
{ "version": "1.0", "timestamp": "2019-07-03T11:42:44.077Z", "business_id": 343, "business_name": "<BUSINESS_NAME>", "event_name": "webhook_conversation_inactivity", "user": { "auth_id": "<AUTH_ID>", "device_platform": "<DEVICE_PLATFORM>", "device_platform_name": "<DEVICE_PLATFORM_NAME>", "user_name": "<USER_NAME>", "user_id": "<USER_ID>", "phone_model": "<PHONE_MODEL>", "os_version": "<OS_VERSION>", "package_name": "<PACKAGE_NAME>", }, "agent": { "id": 4415, "name": "gogo", "profile_image": "https://assets.haptikapi.com/content/42e123411bk1109823bf.jpg", "is_automated": true, "email": null }, "follow_up_details": { // This dict will be empty when followup is not present "follow_up_timestamp": 1597668000, "send_to": 1, // 1/ 2 / 3, (Expert / User / Both) "expert_name": "expert", "comment": "follow up comment", "team_id": 2 }, "data": { "conversation_no": "<CONVERSATION_NO>", "collection_id": "<COLLECTION_ID>", "conversation_identifier": "<CONVERSATION_IDENTIFIER>", "chat_link":"<CHAT_LINK>", // deprecated. use `complete_chat_link` instead "complete_chat_link": "<CHAT_LINK>", "completion_type": "agent", // possible values 'gogo', 'agent', 'autocomplete' depends who marked the chat complete "completion_by": "<AGENT_CLAIM_NAME>", // the state of a conversation before it was marked as completed. //Possible values 'AGENT_CLAIM_NAME', 'Team Offline Flag', 'Waiting for User', 'Bot completed' "closing_categories": { "reason": "", "subReason": "", "comment": "" }, "conversation_details": { "insurance_no": "CDQP12324", "payment_mode": "COD" }, "user_details": { "phone_number": 8826755986, "date_of_birth": "21/07/1995" } } }