fulfillment-webhook-json icon indicating copy to clipboard operation
fulfillment-webhook-json copied to clipboard

Custom payload for platforms like Telegram, Facebook, Slack

Open crispywong opened this issue 5 years ago • 2 comments

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.

crispywong avatar Mar 29 '19 05:03 crispywong

Hi, I also have this question.

hcharley avatar Aug 08 '19 13:08 hcharley

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."
            }
          }
 }
Screen Shot 2021-01-20 at 2 09 56 PM

nguyendn avatar Jan 20 '21 22:01 nguyendn