Google Spreadsheet API form PHP on a Cron Job

937 Views Asked by At

There is SO MUCH information about google APIs. So I'm getting lost in all the research.

My goal:

I have a spreadsheet under my google docs account. I want to run a cron job every day, pull cell values from a specific cell (it increases to the next row each day) and then do some other API calls to other services, then write the results in another column in that same row.

Most of the oAuth 2.0 stuff needs to ask the user, which can't happen in a cron job. I found something about a service account, but thats a whole new type of account, and it seems to have it's own credentials. I already have 4 types of security credentials created.

Question) How do I authenticate my google account in PHP without asking anything to the user?

The URL I want to use with cURL after authentication is this

https://spreadsheets.google.com/tq?tqx=out:json&tq=<QUERY>&key=<MY KEY>

Thanks to anyone who can help!

0

There are 0 best solutions below