0
votes

I currently use a get Request in a Google Chrome App to pull events of my Calendar (API v3). Everything works fine, but when I use maxResults to limit the output, I get

"message": "Invalid integer value: '20?

The code is:

var xhr = new XMLHttpRequest();
xhr.open("GET", "https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=20?access_token="+token, true);
xhr.send();

Why isn't this recognized as an integer?

1

1 Answers

1
votes

OK, this was obvious: I missed a question mark (only first parameter uses a question mark, all others following use &). So instead of

xhr.open("GET", "https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=20?access_token="+token, true)

it should have been

xhr.open("GET", "https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=20&access_token="+token, true)