Dialogflox CX - Messenger and dfMessenger.setQueryParameters ...

Hi,

I am using the DF CX Messenger integration and noticed there is a JavaScript function to set additional query parameters (https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger/javascript-functions#setqueryparameters). I have used this and I can see query parameters been sent over the network, but how do I access these in Dialogflow CX? I thought I could use $session.params.<parameter_name> but this doesn’t seem to work.

Can anybody advise please?

Thanks!

you will need to specify them like this:

const dfMessenger = document.querySelector('df-messenger');
const queryParameters = {
  parameters: {
      test: "hello"
  }
};
dfMessenger.setQueryParameters(queryParameters);

then you can access it like this: $session.params.test

Ah, thank you! It seems the documentation is missing the “parameters” key in their example. This worked for me!

awesome!