2

I am using Dialogflow's Messenger from https://cloud.google.com/dialogflow/docs/integrations/dialogflow-messenger, and was trying to find a way to pass some custom payload to be used during fulfillment. Through HTML customizations, it is possible to pass a user-id which will be passed to DialogFlow through the queryParams.payload field. Is there a way to pass more info other than user-id, through another way?

I was exploring the use of AJAX interceptors to intercept the body of the XHR request to Dialogflow, and am able to intercept the body as {"queryInput":{"event":{"name":"WELCOME","languageCode":"en"}}}. I was wondering if it would be possible to add a custom payload and retrieve it through fulfillment, such as {"queryInput":{"event":{"name":"WELCOME","languageCode":"en"}},"queryParameters":{"payload":{"payloadkey":"payloadvalue"}}} to extract the custom payload.

Does anyone know a solution to this?

  • Got it! For anyone who's wondering, you will have to intercept the body of the request, and add to it a "queryParams": {"payload": {.....}} element! – Austine Yapp Jun 08 '20 at 12:52
  • Hi Austine, can you put an example about how to pass the custom payload? I am using the event df-request-sent but i dont know how to pass the param. I am using the next documentation. https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger#df-request-sent – Arsenio Aguirre Feb 18 '21 at 01:31

0 Answers0