Note
If you’re using Node.js, the preferred integration is with our
NPM.
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 Google posts to your webhook endpoint, post the same data Google sent to you to the following endpoint:
https://tracker.dashbot.io/track?platform=google&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"request_body": {
"originalRequest": {
"data": {
"isInSandbox": true,
"surface": {
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"user": {
"locale": "en-US",
"userId": "APhe68EDOxlex9HCuUj3gsZaWoZa"
},
"inputs": [
{
"rawInputs": [
{
"inputType": "KEYBOARD",
"query": "talk to my test app"
}
],
"intent": "actions.intent.MAIN"
}
],
"conversation": {
"type": "NEW",
"conversationId": "1501533781539"
}
},
"version": "2",
"source": "google"
},
"result": {
"actionIncomplete": false,
"score": 1,
"metadata": {
"intentId": "abad66de-d382-4bf7-90e3-35f77ae83cc6",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"nluResponseTime": 1,
"intentName": "Default Welcome Intent"
},
"resolvedQuery": "GOOGLE_ASSISTANT_WELCOME",
"action": "input.welcome",
"source": "agent",
"contexts": [
{
"name": "google_assistant_welcome",
"lifespan": 0
},
{
"name": "actions_capability_screen_output",
"lifespan": 0
},
{
"name": "actions_capability_audio_output",
"lifespan": 0
},
{
"name": "google_assistant_input_type_keyboard",
"lifespan": 0
}
],
"fulfillment": {
"speech": "Hi!",
"messages": [
{
"type": 0,
"speech": "Hi!"
}
]
}
},
"id": "166fdebd-052f-4c08-85ef-ada758d8037f",
"sessionId": "1501533781539",
"lang": "en",
"timestamp": "2017-07-31T20:43:01.572Z",
"status": {
"errorType": "success",
"code": 200
}
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"request_body":{"originalRequest":{"data":{"isInSandbox":true,"surface":{"capabilities":[{"name":"actions.capability.AUDIO_OUTPUT"},{"name":"actions.capability.SCREEN_OUTPUT"}]},"user":{"locale":"en-US","userId":"APhe68EDOxlex9HCuUj3gsZaWoZa"},"inputs":[{"rawInputs":[{"inputType":"KEYBOARD","query":"talk to my test app"}],"intent":"actions.intent.MAIN"}],"conversation":{"type":"NEW","conversationId":"1501533781539"}},"version":"2","source":"google"},"result":{"actionIncomplete":false,"score":1,"metadata":{"intentId":"abad66de-d382-4bf7-90e3-35f77ae83cc6","webhookUsed":"true","webhookForSlotFillingUsed":"false","nluResponseTime":1,"intentName":"Default Welcome Intent"},"resolvedQuery":"GOOGLE_ASSISTANT_WELCOME","action":"input.welcome","source":"agent","contexts":[{"name":"google_assistant_welcome","lifespan":0},{"name":"actions_capability_screen_output","lifespan":0},{"name":"actions_capability_audio_output","lifespan":0},{"name":"google_assistant_input_type_keyboard","lifespan":0}],"fulfillment":{"speech":"Hi!","messages":[{"type":0,"speech":"Hi!"}]}},"id":"166fdebd-052f-4c08-85ef-ada758d8037f","sessionId":"1501533781539","lang":"en","timestamp":"2017-07-31T20:43:01.572Z","status":{"errorType":"success","code":200}}}'
'https://tracker.dashbot.io/track?platform=google&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 Google accepts.
When your bot sends a message, POST to the following endpoint:
https://tracker.dashbot.io/track?platform=google&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"request_body": {
"originalRequest": {
"data": {
"isInSandbox": true,
"surface": {
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
}
]
},
"user": {
"locale": "en-US",
"userId": "APhe68EDOxlex9HCuUj3gsZaWoZa"
},
"inputs": [
{
"rawInputs": [
{
"inputType": "KEYBOARD",
"query": "talk to my test app"
}
],
"intent": "actions.intent.MAIN"
}
],
"conversation": {
"type": "NEW",
"conversationId": "1501533781539"
}
},
"version": "2",
"source": "google"
},
"result": {
"actionIncomplete": false,
"score": 1,
"metadata": {
"intentId": "abad66de-d382-4bf7-90e3-35f77ae83cc6",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"nluResponseTime": 1,
"intentName": "Default Welcome Intent"
},
"resolvedQuery": "GOOGLE_ASSISTANT_WELCOME",
"action": "input.welcome",
"source": "agent",
"contexts": [
{
"name": "google_assistant_welcome",
"lifespan": 0
},
{
"name": "actions_capability_screen_output",
"lifespan": 0
},
{
"name": "actions_capability_audio_output",
"lifespan": 0
},
{
"name": "google_assistant_input_type_keyboard",
"lifespan": 0
}
],
"fulfillment": {
"speech": "Hi!",
"messages": [
{
"type": 0,
"speech": "Hi!"
}
]
}
},
"id": "166fdebd-052f-4c08-85ef-ada758d8037f",
"sessionId": "1501533781539",
"lang": "en",
"timestamp": "2017-07-31T20:43:01.572Z",
"status": {
"errorType": "success",
"code": 200
}
},
"message": {
"data": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Hello there! Let's chat. Ask me anything, or pat me, amuse me, or ask for help",
"displayText": "Hello there! Let's chat..."
}
},
{
"basicCard": {
"image": {
"accessibilityText": "welcome cat",
"url": "http://i.dashbot.io/cat/pepper-fb.png"
},
"formattedText": "Ask me anything, or pat me, amuse me, or ask for help"
}
}
],
"suggestions": [
{
"title": "pat"
},
{
"title": "amuse"
},
{
"title": "help"
}
]
}
}
},
"speech": "Hello there! Let's chat. Ask me anything, or pat me, amuse me, or ask for help",
"contextOut": [
{
"name": "_actions_on_google_",
"lifespan": 100
}
]
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"request_body":{"originalRequest":{"data":{"isInSandbox":true,"surface":{"capabilities":[{"name":"actions.capability.AUDIO_OUTPUT"},{"name":"actions.capability.SCREEN_OUTPUT"}]},"user":{"locale":"en-US","userId":"APhe68EDOxlex9HCuUj3gsZaWoZa"},"inputs":[{"rawInputs":[{"inputType":"KEYBOARD","query":"talk to my test app"}],"intent":"actions.intent.MAIN"}],"conversation":{"type":"NEW","conversationId":"1501533781539"}},"version":"2","source":"google"},"result":{"actionIncomplete":false,"score":1,"metadata":{"intentId":"abad66de-d382-4bf7-90e3-35f77ae83cc6","webhookUsed":"true","webhookForSlotFillingUsed":"false","nluResponseTime":1,"intentName":"Default Welcome Intent"},"resolvedQuery":"GOOGLE_ASSISTANT_WELCOME","action":"input.welcome","source":"agent","contexts":[{"name":"google_assistant_welcome","lifespan":0},{"name":"actions_capability_screen_output","lifespan":0},{"name":"actions_capability_audio_output","lifespan":0},{"name":"google_assistant_input_type_keyboard","lifespan":0}],"fulfillment":{"speech":"Hi!","messages":[{"type":0,"speech":"Hi!"}]}},"id":"166fdebd-052f-4c08-85ef-ada758d8037f","sessionId":"1501533781539","lang":"en","timestamp":"2017-07-31T20:43:01.572Z","status":{"errorType":"success","code":200}},"message":{"data":{"google":{"expectUserResponse":true,"richResponse":{"items":[{"simpleResponse":{"textToSpeech":"Hello there! Lets chat. Ask me anything, or pat me, amuse me, or ask for help","displayText":"Hello there! Let'"'"'s chat..."}},{"basicCard":{"image":{"accessibilityText":"welcome cat","url":"http://i.dashbot.io/cat/pepper-fb.png"},"formattedText":"Ask me anything, or pat me, amuse me, or ask for help"}}],"suggestions":[{"title":"pat"},{"title":"amuse"},{"title":"help"}]}}},"speech":"Hello there! Let'"'"'s chat. Ask me anything, or pat me, amuse me, or ask for help","contextOut":[{"name":"_actions_on_google_","lifespan":100}]}}'
'https://tracker.dashbot.io/track?platform=google&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.