Each bot needs its own API key for tracking.
Create a bot to get an API key.
npm install --save dashbot
Use the API key created above.
const dashbot = require('dashbot')(<strong>process.env.DASHBOT_API_KEY</strong>).google;
app.use(bodyParser.json())
...
app.post('/guessnumber', (request, response) => {
<strong>dashbot.logIncoming(request.body);</strong>
...}
const msg = {
speech: "I’m thinking of a number from 0 and 100. What’s your first guess?",
data: { google: { expect_user_response: true } },
contextOut: [
{
name:"game",
lifespan:100,
parameters:{
answer:72
}
}
]
}
<strong>dashbot.logOutgoing(request.body, msg);</strong>
response.send(msg);
View sample code.