0

I'm getting the following message:

'Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/tasks/v1/users/@me/lists: (403) Insufficient Permission''.

I'm using OAuth 2.0 and it works fine with the Calendar API, but the Tasks API with the same credentials throws the above exception. (I'm trying to run the example file coming with the api library.)

Amal Murali
  • 75,622
  • 18
  • 128
  • 150

1 Answers1

0

Try this code:

gapi.client.load('oauth2', 'v2', function() {
      gapi.client.oauth2.userinfo.get().execute(function(resp) {
        console.log(resp.name);
        gapi.client.load('tasks', 'v1', function(res) {
            gapi.client.request({
              'path': '/tasks/v1/users/@me/lists',
              'callback': YourCallBackFunction
            });
        });
      });
    });
Kevin Brechbühl
  • 4,717
  • 3
  • 24
  • 47