I am trying to write a standalone perl application that lists all my tasks stored in Google Tasks. I am convinced that I can use what Google calls the "Simple API Access" because it is only my task and it is only read.
So, I did the following:
#!perl use LWP; my $browser = LWP::UserAgent->new; my $list = "Iyrhxu8sRTVOhE4hUBr4W1kwNTI6MDow"; my $key = "<api key removed>"; my $url = "https://www.googleapis.com/tasks/v1/lists/$list/tasks?pp=1&key=$key"; print $browser->get($url)->content;
In return, I get:
{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }
Unfortunately, I have no idea what permission he wants at this moment. I tried replacing the last line:
my $auth = "..."; print $browser->get($url, "Authorization", $auth)->content;
and using the Google client ID, email address, and client secret listed in the API console, but they all gave Invalid Credentials
.
Can anyone help?
source share