Zaid Iqbal
Zaid Iqbal

Reputation: 1682

Google Calendar API insufficient permission

On making API call I am getting an error of "insufficient permission" error on calling Google calendar API. Please Help me I have wasted a lot of time in this. The Access token is getting correct and it is validated as well but when i do make an API call it gives me the error.

var scope='https://www.googleapis.com/auth/calendar';
    var TokenResp="ya29.1.AADtN_WFzHPhwPCU_UXnxcsDRfMfpKgACnPcJA74r8lmB1pQL22iOZUS_tofGA1TAw";
    $.ajax({
                url: "https://www.googleapis.com/oauth2/v1/userinfo?access_token=" + TokenResp,
                //data: { 'Authorization': 'Bearer ' + TokenResp },
                type: "GET",
                success: function (audata) {
                    //alert('Success!' + JSON.stringify(audata));
                }
            });

This is the code to make the API call https://developers.google.com/accounts/docs/OAuth2UserAgent.

Upvotes: 3

Views: 1259

Answers (1)

Ilya Kharlamov
Ilya Kharlamov

Reputation: 3932

delete the previous auth key file 'token.json' from the current folder

Upvotes: 1

Related Questions