Page 1 of 1

Oauth 2.0 for Google Api

Posted: 09 Sep 2019 20:40
by GhostTheToast
Hello,

I'm trying to setup a flow where I can enter data points that I would like to track and have it append to a google sheet in my drive. I have been going about this with an 'HTTP Request' action, but I'm getting an error about not being able to certify who I am. Any advice or help would be appreciated.

Thank you

Re: Oauth 2.0 for Google Api

Posted: 10 Sep 2019 06:12
by Desmanto
Is it a must to append directly to google sheet? Why don't just save it to glovar first or text file first? And later once in a while, open this text file, open google sheet in browser and append it manually.

Other method is to download the file from the gdrive (search google drive action), append the text and and upload it back. But this only work for text file too, not spreadsheet file, except csv.

Re: Oauth 2.0 for Google Api

Posted: 10 Sep 2019 06:54
by anuraag
You will need a access_token to do http request. I have requested Martin to implement http auth (like tasker's recent feature) in Automagic a month ago.

Easy way to get access_token is to use Autoweb plugin. IAP costs ~$4.

Other method is to get client_id and client_secret from console.developers.google.com and send a post request to https://www.googleapis.com/oauth2/v4/token. I have implemented this method to get my access_token which i use to sync my files to google drive.

Edit: here is steps to generate access_token.
https://medium.com/@pablo127/google-api ... 03c897fd98
You will need one more step to renew access_token using refresh_token.