9

Is there a way to programmatically create a new dialogflow agent programmatically?

I've done gcloud projects create [name] followed by gcloud services enable dialogflow.googleapis.com

I assumed this would be enough to use the projects.agent.import API but the API is giving an error:

Dialogflow API has not been used in project {REDACTED} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dialogflow.googleapis.com/overview?project={REDACTED} then retry.

Is there really no way to spin up a new project without interacting with the dialogflow console?

4 Answers 4

4

According to new release you can now create agents with Rest API,

  1. https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects/agent

For more info, Release Note of June 13, 2019

https://cloud.google.com/dialogflow/docs/release-notes

Sign up to request clarification or add additional context in comments.

3 Comments

please raise your issue if you find any issues wile creating, will surely try to help
To create an agent is mandatory to create a Google Cloud project first, right? How can I create a project using the REST API?
1

You can now create and update agents with the API. See the REST and RPC documentation.

Comments

0

Unfortunately you can't create any agent directly from their dashboard, though if you can pass the api which can fetch the agent creation function then might be its been possible. It might be tough at the beginning and not sure whether google will approve it or not as they offer the integration only at the end to deliver the service.

1 Comment

Good news, this is no longer correct. See recent answer
-1

If you check the v2 API documentation, you won't find any create method for projects.agent.

What you are doing is to create a new project. You should first assign the Dialogflow API to the project in Google Cloud Platform.

enter image description here

3 Comments

As mentioned, I have programmatically created the project and enabled this API on it... still get the error. Have you seen this working?
It wasn't really clear what you mentioned in your question with "I've done"... Apparently no, you need to access that page, probably to give a "human touch" and prevent the creation of thousand of bots. I would say that's a understandable limitation. Said that, have you tried hitting that link using cURL?
I have tried to do it but no success. We need access to dialogflow , without any firewall restrictions etc. At most we can spin a new project by importing an existing dialogflow template which consists of intents, entities and agent json files .

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.