0

I am using flexible webhooks. After an intent has been matched, I want to make a flexible webhook call and I want to pass the detected language code to my webhook controller. I know that the language code is present in the standard webhook requests with the name 'languageCode', but I can't figure out how to get access to this value if I am not using standard webhooks. Clearly, after an intent has been matched, the language is known to Dialogflow CX. How can I pass this language code to my flexible webhooks?

Thanks

Peter
  • 93
  • 1
  • 1
  • 3

1 Answers1

0

There is no big difference in passing values in standard webhook and flexible webhook. The languageCode can be passed by including it in Webhook Request in a JSON body.

Sample webhook request:

{
   "detectIntentResponseId": string,
   "languageCode": string,
   "sessionInfo": {
       object  }
}

Just follow this creation of webhook resource documentation and apply the flexible webhook resource settings.

Poala Astrid
  • 1,028
  • 2
  • 10
  • I guess my question is, where is the language code stored in Dialogflow? Is it in $session.params? Is it in $intent.params? I can't find it anywhere so I don't have access to it. If I can't reference it, I can't pass it to my flexible webhook. If the webhook doesn't know the agent's language, it can't provide a fulfillment response because it doesn't know in what language it should provide the response. If I use standard webhooks, the language is included in the starndard webhook request object (languageCode). But I prefer to use flexible webhooks. But the language issue is a problem. – Peter Jun 28 '23 at 17:15