Pass Custom Outgoing Intents for Google
Outbound Intents are an optional, advanced feature.
With Intents, you can roll up similar messages your bot sends to quickly see the combined metrics.
Here is how we define an intent:
- intent – object – (optional)
- name – string
- inputs – array
- input – object
- name – string
- value – string
- input – object
Intents can be sent for either inbound or outbound messages. Place the intent object at the root level of the JSON that you send for each inbound or outbound message, or use the NPM module.
Adding an Intent for an outbound message
Example: “The weather is 68 degrees and sunny.”
Define Intent
The message “The weather is 68 degrees and sunny.” maps to the WEATHER_RESPONSE Intent with the “forecast” entity “68 and sunny”
{"name": "WEATHER_RESPONSE","inputs": [{"name": "forecast","value": "68 and sunny"}]}
Log outbound Intent via NPM
dashbot.logOutgoingIntent({"name": "WEATHER_RESPONSE","inputs": [{"name": "forecast","value": "68 and sunny"}]});
Special NotHandled Intent
By passing the NotHandled
intent, this will enable the special report to show you which messages were not handled by your skill
Log outbound Intent via NPM
dashbot.logOutgoingIntent({ "name": "NotHandled" });