Park Jay
Park Jay

Reputation: 279

get calendar list by using google calendar api through postman

I am currently working with Google Calendar API and try to get calendar list by using postman, but I don't know its standard format. I try to give it the Authorization header.

GET /calendar/v3/users/me/calendarList?key=AIzaSyD-a9IF8KKYgoC3cpgS-Al7hLQDbugrDcw HTTP/1.1
Host: www.googleapis.com
Content-Type: application/json
Authorization: Bearer ya29.Glw2BZv7G1Yq9uOk1YoDeRt3N6A_QehUexSRriiVc9Vu9Jn5uPeVZMbqa41xuFJtTbal-kZo0USmBw-JtxMnYR8tAFUnVPiSuZMsiKavV0F9u2sZ3KpvZiDUxv3r3Q
Cache-Control: no-cache
Postman-Token: 28c59154-4267-f007-a627-64a19e8bb6ec

The first time I receive usage limit error, and second time is Invalid Credentials error, I am really sure that the token is right. Because of don't know that the request is right or not so I don't know how to resolve it. Please help me.

Upvotes: 3

Views: 6473

Answers (1)

Tanaike
Tanaike

Reputation: 201378

In your situation, when you use access token, the query of key={YOUR_API_KEY} is not required. Please use GET https://www.googleapis.com/calendar/v3/users/me/calendarList as the endpoint.

Even if you modified above, when the same error occurs, can you confirm following points again?

  1. What scopes did you include to the access token?
    • In order to retrieve calendar list, https://www.googleapis.com/auth/calendar.readonly or https://www.googleapis.com/auth/calendar have to be included to the scope.
  2. Did you enable Calendar API?
    • You can confirm this at the URL of https://console.cloud.google.com/apis/library/calendar-json.googleapis.com/?q=calendar&project=project-id-#####.
    • When you access above URL, please replace ##### to your project ID.
  3. The expiration time of the access token is 1 hour, from when the access token was retrieved.

If this was not useful for you, I'm sorry.

Upvotes: 2

Related Questions