get the list of pages in a agent

178 views
Skip to first unread message

JM Chetan Kumar

unread,
Apr 26, 2022, 10:31:09 AM4/26/22
to Dialogflow CX Edition users
How to get the list of pages and its IDs in a agent.

But when i enter my parent value i get "400 Please switch to 'us-central1-dialogflow.googleapis.com' to access resources located in 'us-central1'"

I checked in stackover but nothing helped me to resolve.
Can someone guide me here please. I am new to this


Thanks in advance

Raul Saucedo Ramirez

unread,
Apr 26, 2022, 2:31:53 PM4/26/22
to Dialogflow CX Edition users

The agent needs to be created with an endpoint ID referencing the location.

 dialogflow.NewSessionsClient(ctx, option.WithEndpoint("us-east1-dialogflow.googleapis.com:443"))

Ed Elrod

unread,
May 4, 2022, 5:52:36 PM5/4/22
to Dialogflow CX Edition users
If you look at the node.js version of that sample, https://github.com/googleapis/nodejs-dialogflow-cx/blob/main/samples/list-page.js , it includes the location in the parent parameter.
     const listPageRequest = {
        parent: `projects/${projectId}/locations/${location}/agents/${agentId}/flows/${flowId}`,

        languageCode: 'en',
};
     const response = await pagesClient.listPages(listPageRequest);

It doesn't acknowledge location anywhere else that I've noticed.  You might (should?) be able to run the request in Python with a similar parent parameter.  Also, btw, agentId and flowId are GUIDs, not friendly names like 'myAgent' or 'balanceFlow'.

-Ed
Reply all
Reply to author
Forward
0 new messages