Google Simple API Access - authorization required, but how?

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?

+6
source share
1 answer

It does not seem to work, they seem to have disabled it in favor of oauth2 and simply did not refresh the application page for api-key. Use Oauth2 instead:

 https://developers.google.com/oauthplayground/ 

If you need an api key, you can get it here:

 https://code.google.com/apis/console 
+1
source

Source: https://habr.com/ru/post/913788/


All Articles