Marco Lamina
Marco Lamina

Reputation: 3634

Google Actions Project REST API?

I am building a Google Actions integration and would like to automate some of the steps like creating and updating a Google Actions project. So far, the only way I see is to use the gactions CLI, as described in the Google Actions Documentation. Is there an API which I can use as a replacement for the CLI tool?

Upvotes: 1

Views: 119

Answers (2)

I was able to sniff the communication between Google and the actions cli. Here is the curl request which you can use. Don't forget to add your Bearer (authorization) and after --data-binary you will include your actions.json. The last thing is, to change the endpoint URL at the end with your action id (replace testskill).

curl 
-H 'Host: actions.googleapis.com' 
-H 'content-type: application/json' 
-H 'authorization: Bearer AuthorisationKeyAsRandomStrings' 
-H 'user-agent: Gactions-CLI/2.2.4 (darwin; amd64; dev/NsZwRCulTKhlPxMfp)' 
--data-binary '{"localizedActionPackages":{"de":{"actions":[{"description":"Default welcome intent","fulfillment":{"conversationName":"testskill"},"intent":{"name":"actions.intent.MAIN","trigger":{"queryPatterns":["sprechen mit test skill"]}},"name":"MAIN"}],"conversations":{"testskill":{"name":"testskill","url":"https://ae8e6xx.ngrok.io/testskill"}},"locale":"de"}},"name":"agents/testskill"}' 
--compressed 'https://actions.googleapis.com/v2/agents/testskill:batchUpdateAllDraftActionPackages'

But there is no guarantee, that this will work in the future because Google can change the endpoint without notifying anybody. So I recommend to stick with actions cli.

Upvotes: 1

Nick Felker
Nick Felker

Reputation: 11968

The APIs which are used by the gactions binary are not publicly accessible. It does make it somewhat challenging to automate its capabilities at the moment.

Upvotes: 1

Related Questions