Suggestions Response on Webhook
When a user responds or interacts with the interactive suggestion elements, related postback information gets posted back to the business as notification through Webhook Post. These are also type of incoming messages with a JSON Payload of predefined format.
Type of Incoming Messages
Following type of messages are considered incoming messages:
- Text: Text messages are freeform responses.
- Suggestions: Suggestion messages are generated by user’s action on the message. Messages include the postback data and text of the suggested action or suggested reply that the user tapped.
- Location: Location messages include latitude and longitude values.
- File: File messages include the URI for a file and associated data.
Note
- All incoming messages from users follows a pre-defined Format.
- This page covers only "Suggestions" and "Location" type of respones.
- For "Text" and "File" type of messages, click here.
Standard JSON Format
{"agent": "{agent name}","phone": "{user phone}","request_id": "{request_id}","session_id": "{session id}","type": "{msg type}",// more object/keys will appear here// related to different type of content"timestamp": "{send time in UTC}",}
JSON Explanation
Key / Object | Data Type | Description |
---|---|---|
agent | String | Name of RBM Agent |
phone | String | Phone number of the person who sent the message to business |
request_id | String | Unique Request ID. Incoming Messages are identified by Request ID |
session_id | String | Session ID of follow-up conversation |
type | String | Enumerated values: text , suggestion , file , location |
timestamp | String | Time when its sent by Sender. In UTC. Format: YYYY-MM-DDTHH:II:SS.000Z |
Response with Suggested Reply
JSON Payload
{"agent": "{agent name}","phone": "{user phone}","request_id": "{request_id}","session_id": "{session id}","type": "suggestion","suggestion": {"type": “reply”,"postback": “{postback text}”,"text": “{text}”,},"timestamp": "{send time in UTC}",}
JSON Explanation: Covers only key/objects related to 'suggestion` Content. For other keys, refer Standard JSON Format explained above.
Key / Object | Data Type | Description |
---|---|---|
type | String | It comes as suggestion |
suggestion | Object | Contains information on the suggested action & response |
JSON Explanation: Covers only information in suggestion
objects
Key / Object | Data Type | Description |
---|---|---|
type | String | It comes as reply to denote response is against suggested reply. |
postback | String | Postback content which was added in postback key of Suggestion Object of Out-Message from business |
text | String | Text content which was added in text key of Suggestion Object of Out-Message from business |
Response on Suggested Action
JSON Payload
{"agent": "{agent name}","phone": "{user phone}","request_id": "{request_id}","session_id": "{session id}","type": "suggestion","suggestion": {"type": “action”,"postback": “{postback text}”,"text": “{text}”,},"timestamp": "{send time in UTC}",}
JSON Explanation: Covers only key/objects related to 'suggestion` Content. For other keys, refer Standard JSON Format explained above.
Key / Object | Data Type | Description |
---|---|---|
type | String | It comes as suggestion |
suggestion | Object | Contains information on the suggested action & response |
JSON Explanation: Covers only information in suggestion
objects
Key / Object | Data Type | Description |
---|---|---|
type | String | It comes as action to denote response on a suggested action. |
postback | String | Postback content which was added in postback key of Suggestion Object of Out-Message from business |
text | String | Text content which was added in text key of Suggestion Object of Out-Message from business |
Response with Location
JSON Payload
{"agent": "{agent name}","phone": "{user phone}","request_id": "{request_id}","session_id": "{session id}","type": "location","location": {"latitude": "{Latitude value}","longitude": "{longitude value}",},"timestamp": "{send time in UTC}",}
JSON Explanation: Covers only key/objects related to 'suggestion` Content. For other keys, refer Standard JSON Format explained above.
Key / Object | Data Type | Description |
---|---|---|
type | String | It comes as suggestion |
location | Object | Contains information on the shared location |
JSON Explanation: Covers only information in location
objects
Key / Object | Data Type | Description |
---|---|---|
latitude | String | Latitude value for the location |
longitude | String | Longitude value for the location |