Using the "Get" Connection
The "Get" Connection Pulls Data into Your Bot
You can pull data into your bot using a "Get" Connection.
Use the GET connection to pull data from your own API, and either save that data down to Attributes in your bot or forward it right along to Facebook as part of a conversation with a contact.
To retrieve data from an API and save it to Contact attributes
You can use data gathered in a chat conversation to retrieve data stored in another system which can they be saved and displayed in that same (or subsequent) chat conversations. Simply select Attributes to save from the dropdown at the bottom of your Connection detail screen.
Example: ask a contact for their email address and use that to retrieve their package's estimated arrival date from an internal orders database.
"attribute1" : "value1",
"attribute2" : "value2"
In the above example, when this connections is triggered (either by a widget or by an Audience condition), value1 and value2 will be applied to attribute1 and attribute2 for the contact.
If the attributes don't yet exist, they will be created. If values already exist for these attributes for the contact, they will be overwritten.
To pass through data from an API to a bot conversation
Another options is to retrieve data from your API formatted as a text or image message to be delivered directly to the contact in conversation.
Example: The user provides you with a zip code, and you send them a picture and description of a home you have for sale in or near that zip code.
Sample JSON response for a text message:
"text" : "hello, world!"
Sample JSON response for an image message:
Sample JSON response for a message containing an attachment:
If there are other types of Messenger formats you'd like to see support for in this feature, please contact us at firstname.lastname@example.org