3

I have a DialogFlow application which I want to enable CI for. I want my Continuous Integration server to upload the JSON for the entire application programmatically, from command line. I wasn't able to find how I can upload the JSON in the application, replacing the current version, using command line.

I can only choose "Import From Zip" or "Restore From Zip" in the Console, under the Import/Export section. I need to be able to do this from the command line, so I can do it automatically when new code is checked in.

Does anyone know how this can be accomplished?

UPDATE: In the DialogFlow API docs (https://dialogflow.com/docs/reference/agent/intents), it describes that you can execute REST operations such as PUT and POST on intents, entities, contexts etc. But this is on a one-by-one basis. So it increases the amount of scripting logic that I have to write to deploy CI.

What I was wondering was: if there was a much simpler command line data upload for the entire dialog flow application (not one intent at a time through the API)

UPDATE 2: Someone referred me to the "gactions CLI" (https://developers.google.com/actions/tools/gactions-cli), which is used to test and update the Actions on Google app. However, I don't believe this applies to the DialogFlow code. I need to update DialogFlow, and not just the Actions on Google app.

FranticRock
  • 3,233
  • 1
  • 31
  • 56

1 Answers1

2

gActions CLI will only work for testing Actions on Google but what you can use is the agent.restore API found here, https://dialogflow.com/docs/reference/api-v2/rest/v2/projects.agent/restore. You can send a ZIP file with the exported agent using the agent.restore method and the agent will be restored to the state described in the ZIP file in the same way as if you were to restore the agent via the Dialogflow console.

The request will look like this:

POST https://dialogflow.googleapis.com/v2/{parent=projects/*}/agent:restore
Sarah Dwyer
  • 529
  • 5
  • 22