fulfillment-webhook-json
fulfillment-webhook-json copied to clipboard
Custom payload for platforms like Telegram, Facebook, Slack
Hi,
I would like to ask how to custom payload for carousel, image in other platforms like Facebook, Telegram and etc.
Information
DialogFlow API version: V2 API Node version: v8.10.0 body-parser version: ^1.18.3 express: ^4.16.4
This is code snippet to return carousel response to Telegram and Google. It worked in google assistant but failed to display carousel list in Telegram. Only text "Category list" was displayed in Telegram.
return res.json({
payload: {
google: {
expectUserResponse: true,
systemIntent: {
intent: "actions.intent.OPTION",
data: {
"@type":
"type.googleapis.com/google.actions.v2.OptionValueSpec",
carouselSelect: {
items: [
{
optionInfo: {
key: "car",
synonyms: ["automobile", "vehicle"]
},
description: "A four wheel vehicle",
title: "Car"
},
{
optionInfo: {
key: "plane",
synonyms: ["aeroplane", "jet"]
},
description: "A flying machine",
title: "Plane"
}
]
}
}
},
richResponse: {
items: [
{
simpleResponse: {
textToSpeech: "Category List"
}
}
]
}
},
telegram: {
text: "Category list",
expectUserResponse: true,
systemIntent: {
intent: "actions.intent.OPTION",
data: {
"@type":
"type.googleapis.com/google.actions.v2.OptionValueSpec",
carouselSelect: {
items: [
{
optionInfo: {
key: "car",
synonyms: ["automobile", "vehicle"]
},
description: "A four wheel vehicle",
title: "Car"
},
{
optionInfo: {
key: "plane",
synonyms: ["aeroplane", "jet"]
},
description: "A flying machine",
title: "Plane"
}
]
}
}
}
}
},
outputContexts: []
});
Is there any mistake in the payload for Telegram? Could anyone provide guidance on this?
Thanks in advanced.
Thank you.
Regards.
Hi, I also have this question.
Same here, I tried the payload below on Slack but only fulfillmentText
works
"fulfillmentText": "This is a text response",
"source": "local",
"payload": {
"slack": {
"text": "This is a text response for Slack."
}
}
}