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 / ObjectData TypeDescription
agentStringName of RBM Agent
phoneStringPhone number of the person who sent the message to business
request_idStringUnique Request ID. Incoming Messages are identified by Request ID
session_idStringSession ID of follow-up conversation
typeStringEnumerated values: text, suggestion, file, location
timestampStringTime 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 / ObjectData TypeDescription
typeStringIt comes as suggestion
suggestionObjectContains information on the suggested action & response

JSON Explanation: Covers only information in suggestion objects

Key / ObjectData TypeDescription
typeStringIt comes as reply to denote response is against suggested reply.
postbackStringPostback content which was added in postback key of Suggestion Object of Out-Message from business
textStringText 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 / ObjectData TypeDescription
typeStringIt comes as suggestion
suggestionObjectContains information on the suggested action & response

JSON Explanation: Covers only information in suggestion objects

Key / ObjectData TypeDescription
typeStringIt comes as action to denote response on a suggested action.
postbackStringPostback content which was added in postback key of Suggestion Object of Out-Message from business
textStringText 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 / ObjectData TypeDescription
typeStringIt comes as suggestion
locationObjectContains information on the shared location

JSON Explanation: Covers only information in location objects

Key / ObjectData TypeDescription
latitudeStringLatitude value for the location
longitudeStringLongitude value for the location