I get the error "Unexpected. Please try again." while accessing adsense reports through Google Api. Executing the below query in BigQuery browser tool works like a charm. Note: I use the server2server authentication.
SELECT date, SUM(earnings) FROM [google.com:adsense-reports:Reports.DailyReport] GROUP BY date
To ensure my code is correct I run this query and it worked:
select word from [publicdata:samples.shakespeare] where word="sleep"
Now I am wondering what's wrong with my approach or what am I missing?
One of the failing jobs:
job_034df770bf77401d91613240a4cfb0f6
Thanks in advance!
EDIT: the script uses php