Question

I have a problem accessing caldav based on these directions: https://developers.google.com/google-apps/calendar/caldav/v2/guide

My problem is: https://apidata.googleusercontent.com/caldav/v2/my_username@gmail.com/events?access_token={A_BEARER_TOKEN}

returns null

It says I need to use oauth2, but doesn't specify where I need to put the token in the API code. I could find no examples, so i assumed it was the same as their non-caldav api. That's why I added my bearer token at the end of the URL as an "?access_token={A_BEARER_TOKEN}".

When I use their proprietary Google API (not caldav) with this token, it works just fine. So I assume that my oauth worked properly.

Since they make no mention of what to use for CalDav, I am using "scope=https://www.googleapis.com/auth/calendar" and "access=offline" when I request the oAuth token. (This is what works for their propietary API).

Also, I have not made my calendar public. It is my assumption that if I use oauth for authentication, sharing is not necessary.

Was it helpful?

Solution

You need to pass the bearer token in the Authorization header of your request. See https://www.rfc-editor.org/rfc/rfc6750#section-2.1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top