Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

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-func...).  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!

Solved Solved
0 3 627
1 ACCEPTED SOLUTION

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

View solution in original post

3 REPLIES 3

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!