'timemin and timemax don't output events in the timeframe defined
I am trying to get any google calendar events that exist between 07:30 until 08:30.
timemin="2022-04-09T07:30:00Z"
timemax="2022-04-09T08:30:00Z"
curl \
"https://www.googleapis.com/calendar/v3/calendars/$calendar_id/events?key=$api_key&singleEvents=true&?timeMin=$timemin&timeMax=$timemax" \
--header "Authorization: Bearer $access_token" \
--header 'Accept: application/json' \
--compressed
This is the output, which is great.
{
"kind": "calendar#events",
"etag": "\"p320bfcefhm3fe0g\"",
"summary": "[email protected]",
"updated": "2022-04-09T04:07:36.240Z",
"timeZone": "Asia/Nicosia",
"accessRole": "owner",
"defaultReminders": [],
"nextSyncToken": "CIC3sc-NhvcCEIC3sc-NhvcCGAUgzrWs0QE=",
"items": [
{
"kind": "calendar#event",
"etag": "\"3298954511466000\"",
"id": "2d5d4pgjg8jbiq1vkath3ftj2b",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MmQ1ZDRwZ2pnOGpiaXExdmthdGgzZnRqMmIgY3lwcnVzbWFuMEBt",
"created": "2022-04-09T04:07:35.000Z",
"updated": "2022-04-09T04:07:35.733Z",
"summary": "Aristos 99435181",
"creator": {
"email": "[email protected]",
"self": true
},
"organizer": {
"email": "[email protected]",
"self": true
},
"start": {
"dateTime": "2022-04-09T07:30:00+03:00",
"timeZone": "Asia/Nicosia"
},
"end": {
"dateTime": "2022-04-09T08:00:00+03:00",
"timeZone": "Asia/Nicosia"
},
"iCalUID": "[email protected]",
"sequence": 0,
"reminders": {
"useDefault": true
},
"eventType": "default"
}
]
}
To make sure this actually works, I change the date to tomorrow's date.
timemin="2022-04-10T07:30:00Z"
timemax="2022-04-10T08:30:00Z"
curl \
"https://www.googleapis.com/calendar/v3/calendars/$calendar_id/events?key=$api_key&singleEvents=true&?timeMin=$timemin&timeMax=$timemax" \
--header "Authorization: Bearer $access_token" \
--header 'Accept: application/json' \
--compressed
But I still get the same output, showing today's event (2022-04-09)
{
"kind": "calendar#events",
"etag": "\"p320bfcefhm3fe0g\"",
"summary": "[email protected]",
"updated": "2022-04-09T04:07:36.240Z",
"timeZone": "Asia/Nicosia",
"accessRole": "owner",
"defaultReminders": [],
"nextSyncToken": "CIC3sc-NhvcCEIC3sc-NhvcCGAUgzrWs0QE=",
"items": [
{
"kind": "calendar#event",
"etag": "\"3298954511466000\"",
"id": "2d5d4pgjg8jbiq1vkath3ftj2b",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MmQ1ZDRwZ2pnOGpiaXExdmthdGgzZnRqMmIgY3lwcnVzbWFuMEBt",
"created": "2022-04-09T04:07:35.000Z",
"updated": "2022-04-09T04:07:35.733Z",
"summary": "Aristos 99435181",
"creator": {
"email": "[email protected]",
"self": true
},
"organizer": {
"email": "[email protected]",
"self": true
},
"start": {
"dateTime": "2022-04-09T07:30:00+03:00",
"timeZone": "Asia/Nicosia"
},
"end": {
"dateTime": "2022-04-09T08:00:00+03:00",
"timeZone": "Asia/Nicosia"
},
"iCalUID": "[email protected]",
"sequence": 0,
"reminders": {
"useDefault": true
},
"eventType": "default"
}
]
}
How do I configure timemin and timemax to get the events within the timeframe 2022-04-09T07:30:00 - 2022-04-09T08:30:00?
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
