Each bot needs its own API key for tracking.
Create a bot to get an API key.
There are two integration points as outlined below.
When Facebook posts to your webhook endpoint, post the same data Facebook sent to you to the following endpoint:
https://tracker.dashbot.io/track?platform=facebook&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"object": "page",
"entry": [
{
"id": "943703799078240",
"time": 1610470068673,
"messaging": [
{
"sender": {
"id": "1018952661536494"
},
"recipient": {
"id": "943703799078240"
},
"timestamp": 1610470068673,
"message": {
"mid": "mid.1468531733396:9242db91fea253e355",
"seq": 978,
"text": "Hi, bot"
}
}
]
}
]
}
curl -X POST -H "Content-Type: application/json"
-d '{"object":"page","entry":[{"id":"943703799078240","time": 1610470068673,"messaging":[{"sender":{"id":"1018952661536494"},"recipient":{"id":"943703799078240"},"timestamp": 1610470068673,"message":{"mid":"mid.1468531733396:9242db91fea253e355","seq":978,"text":"Hi, bot"}}]}]}'
'https://tracker.dashbot.io/track?platform=facebook&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>'
Note
This is just an example — we accept any rich media that Facebook accepts.
When your bot sends a message, POST to the following endpoint:
https://tracker.dashbot.io/track?platform=facebook&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"qs": {
"access_token": "<YOUR ACCESS TOKEN>"
},
"uri": "https://graph.facebook.com/v2.6/me/messages",
"json": {
"message": {
"text": "Hello, my human pet"
},
"recipient": {
"id": "975099989272315"
}
},
"method": "POST",
"responseBody": {
"recipient_id": "975099989272315",
"message_id": "mid.1470371655004:4727480467538e9450"
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"qs":{"access_token":""},"uri":"https://graph.facebook.com/v2.6/me/messages","json":{"message":{"text":"Hello, my human pet"},"recipient":{"id":"975099989272315"}},"method":"POST","responseBody":{"recipient_id":"975099989272315","message_id":"mid.1470371655004:4727480467538e9450"}}'
'https://tracker.dashbot.io/track?platform=facebook&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>'
Note
This is just an example — we accept any rich media that Facebook accepts.
View a complete example.