Webhook Reference
A standard webhook sent by OmniChat has the following format:
Field | Type | Description |
---|---|---|
objectId | string | Informs the id of the object |
resource | string | Informs the type of object that was sent, can it be: Message Interaction Order |
event | string (enum) | Event type on the object: CREATE DELETE UPDATE |
timestamp | timestamp | Event date/time. |
payload | json | Object containing resource data. Only Message resource has this field set. |
Message payload format:
Field | Type | Description |
---|---|---|
chat | json | Tells which conversation the message belongs to. It's a json containing the fields: className ( in this case it will always be 'Chat' ) objectId (id of the chat) The Chat object is a conversation grouper. With it, it is possible to know metadata of the conversation, such as the customer's phone number, the status of the conversation, among others. It is possible to know the Chat data through the endpoint: |
platform | string | Informs the platform of the conversation: WAB-OMNICHAT WAB-DIALOG FBMESSENGER WEBCHAT |
status | string | Informs the status of the message: INCOMING_RECEIVED (received and unread) INCOMING_READ (rreceived and read) INCOMING_DELETED (received and deleted - INSTAGRAM ONLY) OUTGOING_CREATED (created internally but not sent) OUTGOING_SENT (sent) OUTGOING_READ (sent and read) OUTGOING_ERROR (sending error) OUTGOING_SILENT (internal messages that are not sent to the consumer) |
system | boolean | Informs if it is a systemic message. |
type | string | Informs the type of message content: IMAGE TEXT AUDIO VOICE DOCUMENT FILE VIDEO LOCATION PRODUCT VARIANT PAYMENT_REQUEST ORDER_CONFIRMATION ORDER_STATUS COLLECTION VCARD MULTI_VCARD SNOOZE_START SNOOZE_END TEMPLATE BUTTON ORDER_PREVIEW GROUPED INTERACTIVE INTERACTIVE_BUTTON LIST STICKER ROUTING (this specific type is useful for identifying conversation routings) |
text | string | The text of the message |
createdAt | ISO string | Tells you when the message was created |
updatedAt | ISO string | Tells you when the message was updated |
objectId | string | Payload object id (it's the same as the main object) |
routeToUser | json | When the message type is routing and the routing is for the user, this field will be filled in with the information of the user who received the routing. className ( in this case it will always be '_User' ) objectId (id of the User) It is possible to get the User's data through this endpoint |
routeToTeam | json | When the message type is routing and the routing is for a team, this field will be filled in with the information of the team that received the routing. className ( in this case it will always be 'Team' ) objectId (id of the Team) It is possible to get the Team data through this endpoint |
user | json | Omnichat user that sent this message, this field will be filled in with the information of the user who received the routing. className ( in this case it will always be '_User' ) objectId (id of the User) It is possible to get the User's data through this endpoint |
Updated over 1 year ago