0

Since mid of last week I witnessed increasing issues with the events list query params for upper and lower bounds. Since the weekend it is no longer working at all.

Issue summary: Positive timezone offsets no longer accepted in events list query params for time bounds.

Api call:

GET https://www.googleapis.com/calendar/v3/calendars/<myCalendarId>/events

with query params: ?timeMin=2020-12-01T09:31:04+0100

Expected behavior and behavior until around Nov 25th, on some servers until Nov 27th:

{
    "kind": "calendar#events",
    "etag": "\"blahblah\"",
    "summary": "blahblah",
    "updated": "2020-12-01T07:46:56.357Z",
    "timeZone": "Europe/Berlin",
    "accessRole": "owner",
    "defaultReminders": [
        {
            "method": "popup",
            "minutes": 30
        }
    ],
    "nextSyncToken": "blahblah",
    "items": [
    ...

Actual behavior / response body:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "badRequest",
                "message": "Bad Request"
            }
        ],
        "code": 400,
        "message": "Bad Request"
    }
}

Further details: Apparently the "bad request" response is solely induced by the plus (+) symbol before the time zone offset. Changing the "+" to a "-" in the above request will return a valid response as expected only that the offset is wrong (in this case by two hours as it should be). Writing the offset with or without ":" (e.g. +01:00 vs +0100) does not affect results.

Most likely I have missed something like a depreciation of positive time zone offsets or I was anyway using a wrong time format since I am admittedly not an expert in the RFC3339.

The other option is that the Google calendar team has updated their parser in their calendar API and in the wake of that deployed a bug. In that case a test case should be added to the pipeline for testing several time zone offsets including the limits.

I would be happy to receive advice on how to gracefully select and time zone east of UTC. Thanks a lot in advance!

1 Answer 1

1

There is no such deprecation, but when you make an HTTP request you need to URL encode the parameters

Sample:

https://www.googleapis.com/calendar/v3/calendars/primary/events?q=timeMin%3D2020-12-01T09%3A31%3A04%2B0100

enter image description here

2
  • Thanks a lot, with the %2B it works. Honestly I played with the URL.encoding before, and while this requirement is apparently true for the "+" it is not e.g. for the ":" and "=" and "&". Meaning the API still accepts those characters without encoding.
    – BB-5000
    Dec 1, 2020 at 10:17
  • The best is to go on the Try this API, enter your query into the q field and have a look at the resulting cURL window (you need to maximize the Try this API to see it), I pated a screenshot into my solution to show. Dec 1, 2020 at 10:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.