0

I'm using the Google Calendar API and to fetch the events of a calendar, you must send a GET request to the https://www.googleapis.com/calendar/v3/calendars/calendarId/events endpoint.

Problem is calendarId may contain a # like in addressbook#[email protected] and when when I fetch https://www.googleapis.com/calendar/v3/calendars/addressbook#[email protected]/events, it's only actually fetching https://www.googleapis.com/calendar/v3/calendars/addressbook, i.e. the part of the URL before the # (I see it in the Chrome Network tab and I just get GET https://www.googleapis.com/calendar/v3/calendars/addressbook 404 in the console)

So how can I force the fetch() method to use the entire URL ?

1

1 Answer 1

1

You probably need to percent-encode the calendarId:

> encodeURIComponent("addressbook#[email protected]")
"addressbook%23contacts%40group.v.calendar.google.com" 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.