Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Go to Haptik Website
  • Contact Us
  • Home
  • Deployment
  • Bot as an API

Which information is sent as Webhook Payload?

Written by Medha Anand

Updated on July 26th, 2023

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
    Build Deploy Analyse Manage Account Bot Deactivation
  • Bot Building
    Essentials Smart Skills Steps User Messages Bot Responses Entities Connections Customisations User feedback collection Testing Whatsapp Bots NLU Bot Maintenance
  • Smart Agent Chat
    Set up Admin Settings MyChats Section (Agent Inbox) Live Traffic Section Teams Section Archives Section Analytics Plans on Smart Agent Chat
  • Conversation Design
    Design Basics Design Guides Designing for Platforms Designing WhatsApp Bots
  • 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
    Web SDK WhatsApp Facebook Instagram Sunshine Conversation LINE Google Business Messages Telegram MS Teams Bot as an API iOS SDK Android SDK
  • External Agent Tool Setup
    Zendesk Chat Salesforce Service Cloud Freshchat Zoho NICE CXOne Gorgias
  • Analytics & Reporting
    Intelligent Analytics
  • Notifications
    SMS Notifications Success Measurement
  • Commerce Plus
    Catalog Integration Bot Building Guide Channel Deployments Unified ML Pipeline Documentation
  • Troubleshooting Guides
    Error Messages FAQs
  • Release Notes
+ More

Table of Contents

Parameters Payload Types Message Chat Pinned Chat Complete Webhook Conversation Complete Webhook Agent Chat Close Webhook Conversation Inactivity Note

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

The events are supported by all channels such as WhatsApp, Facebook and so on.

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

This event is deprecated in favor of Webhook Conversation 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"
 }
 }
}
Delete

Note

  • Please add a safety check on the keys in the above JSON, before accessing its value to avoid exceptions
  • Our JSON will always be backward compatible for a specific event_name. New keys could be added. But existing keys will not be removed/changed without a version change in the event_name
  • We could add new event_name as per our product requirement. The webhook consumer should not consider a new event_name bug. You can simply ignore it if it is not required for your use case (return 200 as status code for them).

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • What are the security protocols to follow for using APIs?
  • What is Bot as an API?
  • How to ensure API security?
  • How to create/update a Haptik User using API?

Platform

  • Conversation Studio
  • Smart Skills
  • Advanced NLU
  • Intelligent Analytics
  • Omnichannel
  • Smart Agent Chat
  • Enterprise Security
  • Integrations

Solutions

  • Conversational Commerce
  • Lead Generation
  • Customer Care
  • WhatsApp
  • Conversational IVR
  • Google Business Messages

Industries

  • Retail/ E-Commerce
  • Financial Services
  • Travel & Hospitality
  • Telecom

Knowledge

  • ROI Calculator
  • Reports & Research
  • Case Studies
  • Webinars
  • ISAT
  • Tech Blog
  • Business Blog
  • Resources
  • Haptik v/s Yellow
  • Haptik v/s Liveperson
  • Haptik v/s IBM Watson
  • Haptik v/s Verloop
  • Conversations on AI

Company

  • Why Haptik
  • About Us
  • Careers
  • News & Media
  • Awards & Recognition
  • Contact Us
  • Partnerships
  • Investor Relations

Subscribe

Sign up to recieve the latest updates

Find us on

  • Twitter-footer
  • Linkedin-footer
  • YT-footer
  • Insta-footer
  • G2-footer
  • Facebook-footer

Knowledge Base Software powered by Helpjuice

Copyright © jio Haptik Technology Limited 2021 | Data Security & Privacy Policy | GDPR

North America | Asia Pacific | Africa | enterprise@haptik.ai

Definition by Author

0
0