0

I want to fetch a user's Dialogflow agents from a specific data region using Nodejs googleapis package. When I pass europe-west2 to dialogflow.projects.agent.search, I get the following error:

400 - "Dialogflow server in 'us' received request for resources located in 'europe-west2.'"

Do I need to specify the location when I spin up the dialogflow constant with the auth and api version? The only mention of location I found in v2beta1.d.ts is for geoLocation, which wouldn't apply here. There isn't any mention of an apiEndpoint either like in this question asked here.

Here's my code:

const dialogflow = await google.dialogflow({
  auth: oAuth2Client
  version: 'v2beta1'
  // declare location here as well?
})

try {
  const fetchAgentsResponse = await dialogflow.projects.agent.search({
    parent: `projects/-/locations/${location}`
  })
} catch (e) {
  throw e
  // receive the 400 error mentioned above
}

1 Answer 1

0

I edited the Service Path for SessionsClient to take in the bot's location ahead of the detectIntent call.

SessionsClient.servicePath = `${location}-dialogflow.googleapis.com`

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.