Returns events on the specified calendar.
This example returns the events for the calendar having the ID = "support@chilkatcloud.com"
load ./chilkat.dll
set rest [new_CkRest]
# Provide a previously obtained OAuth2 access token.
set oauth2 [new_CkOAuth2]
CkOAuth2_put_AccessToken $oauth2 "OAUTH2_ACCESS_TOKEN"
CkRest_SetAuthOAuth2 $rest $oauth2
set success [CkRest_Connect $rest "www.googleapis.com" 443 1 1]
if {[expr $success != 1]} then {
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
delete_CkOAuth2 $oauth2
exit
}
set sbJson [new_CkStringBuilder]
set success [CkRest_FullRequestNoBodySb $rest "GET" "/calendar/v3/calendars/support@chilkatcloud.com/events" $sbJson]
if {[expr $success != 1]} then {
puts [CkRest_lastErrorText $rest]
delete_CkRest $rest
delete_CkOAuth2 $oauth2
delete_CkStringBuilder $sbJson
exit
}
if {[expr [CkRest_ResponseStatusCode $rest] != 200]} then {
puts "Received error response code: [CkRest_ResponseStatusCode $rest]"
puts "Response body:"
puts [CkStringBuilder_getAsString $sbJson]
delete_CkRest $rest
delete_CkOAuth2 $oauth2
delete_CkStringBuilder $sbJson
exit
}
set json [new_CkJsonObject]
CkJsonObject_LoadSb $json $sbJson
# The following code parses the JSON response.
# A sample JSON response is shown below the sample code.
set kind [CkJsonObject_stringOf $json "kind"]
set etag [CkJsonObject_stringOf $json "etag"]
set summary [CkJsonObject_stringOf $json "summary"]
set updated [CkJsonObject_stringOf $json "updated"]
set timeZone [CkJsonObject_stringOf $json "timeZone"]
set accessRole [CkJsonObject_stringOf $json "accessRole"]
set nextSyncToken [CkJsonObject_stringOf $json "nextSyncToken"]
set i 0
set count_i [CkJsonObject_SizeOfArray $json "defaultReminders"]
while {[expr $i < $count_i]} {
CkJsonObject_put_I $json $i
set method [CkJsonObject_stringOf $json "defaultReminders[i].method"]
set minutes [CkJsonObject_IntOf $json "defaultReminders[i].minutes"]
set i [expr $i + 1]
}
set i 0
set count_i [CkJsonObject_SizeOfArray $json "items"]
while {[expr $i < $count_i]} {
CkJsonObject_put_I $json $i
set kind [CkJsonObject_stringOf $json "items[i].kind"]
set etag [CkJsonObject_stringOf $json "items[i].etag"]
set id [CkJsonObject_stringOf $json "items[i].id"]
set status [CkJsonObject_stringOf $json "items[i].status"]
set htmlLink [CkJsonObject_stringOf $json "items[i].htmlLink"]
set created [CkJsonObject_stringOf $json "items[i].created"]
set updated [CkJsonObject_stringOf $json "items[i].updated"]
set summary [CkJsonObject_stringOf $json "items[i].summary"]
set creatorEmail [CkJsonObject_stringOf $json "items[i].creator.email"]
set creatorSelf [CkJsonObject_BoolOf $json "items[i].creator.self"]
set organizerEmail [CkJsonObject_stringOf $json "items[i].organizer.email"]
set organizerSelf [CkJsonObject_BoolOf $json "items[i].organizer.self"]
set startDateTime [CkJsonObject_stringOf $json "items[i].start.dateTime"]
set endDateTime [CkJsonObject_stringOf $json "items[i].end.dateTime"]
set iCalUID [CkJsonObject_stringOf $json "items[i].iCalUID"]
set sequence [CkJsonObject_IntOf $json "items[i].sequence"]
set hangoutLink [CkJsonObject_stringOf $json "items[i].hangoutLink"]
set remindersUseDefault [CkJsonObject_BoolOf $json "items[i].reminders.useDefault"]
set location [CkJsonObject_stringOf $json "items[i].location"]
set i [expr $i + 1]
}
puts "Example Completed."
delete_CkRest $rest
delete_CkOAuth2 $oauth2
delete_CkStringBuilder $sbJson
delete_CkJsonObject $json
{
"kind": "calendar#events",
"etag": "\"p32gd13choqmte0g\"",
"summary": "support@chilkatcloud.com",
"updated": "2017-11-07T22:49:27.892Z",
"timeZone": "America/Chicago",
"accessRole": "owner",
"defaultReminders": [
{
"method": "popup",
"minutes": 10
}
],
"nextSyncToken": "CKDQjZHGrdcCEKDQjZHGrdcCGAU=",
"items": [
{
"kind": "calendar#event",
"etag": "\"3004746854620000\"",
"id": "5jt9fopfg3rr9eftegiuq7gc5k",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NWp0OWZvcGZnM3JyOWVmdGVnaXVxN2djNWsgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-10T13:57:07.000Z",
"updated": "2017-08-10T13:57:07.310Z",
"summary": "Run 10 miles",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-10T12:00:00-05:00"
},
"end": {
"dateTime": "2017-08-10T13:00:00-05:00"
},
"iCalUID": "5jt9fopfg3rr9eftegiuq7gc5k@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.5jt9fopfg3rr9eftegiuq7gc5k",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004746898118000\"",
"id": "7dvh49vd219r3sq7jdueieu8rc",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=N2R2aDQ5dmQyMTlyM3NxN2pkdWVpZXU4cmMgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-10T13:57:29.000Z",
"updated": "2017-08-10T13:57:29.059Z",
"summary": "Eat Giordano's Pizza",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-10T15:00:00-05:00"
},
"end": {
"dateTime": "2017-08-10T16:00:00-05:00"
},
"iCalUID": "7dvh49vd219r3sq7jdueieu8rc@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.7dvh49vd219r3sq7jdueieu8rc",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004746915224000\"",
"id": "5btd89ljn07bg3tlgpimcaqrro",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NWJ0ZDg5bGpuMDdiZzN0bGdwaW1jYXFycm8gc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-10T13:57:37.000Z",
"updated": "2017-08-10T13:57:37.612Z",
"summary": "Nap",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-10T16:30:00-05:00"
},
"end": {
"dateTime": "2017-08-10T17:30:00-05:00"
},
"iCalUID": "5btd89ljn07bg3tlgpimcaqrro@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.5btd89ljn07bg3tlgpimcaqrro",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004915127736000\"",
"id": "703fss5qdedn1egq80ildhslba",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NzAzZnNzNXFkZWRuMWVncTgwaWxkaHNsYmEgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-11T13:19:23.000Z",
"updated": "2017-08-11T13:19:23.868Z",
"summary": "Run 12 miles",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-12T09:30:00-05:00"
},
"end": {
"dateTime": "2017-08-12T10:30:00-05:00"
},
"iCalUID": "703fss5qdedn1egq80ildhslba@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.703fss5qdedn1egq80ildhslba",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004915160212000\"",
"id": "02pv1cpdp7vm11htnfi3ii7iie",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MDJwdjFjcGRwN3ZtMTFodG5maTNpaTdpaWUgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-11T13:19:40.000Z",
"updated": "2017-08-11T13:19:40.106Z",
"summary": "Eat Lou Malnati's Pizza",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-12T12:00:00-05:00"
},
"end": {
"dateTime": "2017-08-12T13:00:00-05:00"
},
"iCalUID": "02pv1cpdp7vm11htnfi3ii7iie@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.02pv1cpdp7vm11htnfi3ii7iie",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004915175982000\"",
"id": "20l29s2idr5ggorncd3teahm0e",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MjBsMjlzMmlkcjVnZ29ybmNkM3RlYWhtMGUgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-11T13:19:47.000Z",
"updated": "2017-08-11T13:19:47.991Z",
"summary": "Nap",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-12T16:30:00-05:00"
},
"end": {
"dateTime": "2017-08-12T17:30:00-05:00"
},
"iCalUID": "20l29s2idr5ggorncd3teahm0e@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.20l29s2idr5ggorncd3teahm0e",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3004969011208000\"",
"id": "v7kvmsvsoms3hjl5uq423jqhb0",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=djdrdm1zdnNvbXMzaGpsNXVxNDIzanFoYjAgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-08-11T20:48:25.000Z",
"updated": "2017-08-11T20:48:25.604Z",
"summary": "Eat Lou Malnati's Pizza",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-08-12T12:00:00-05:00"
},
"end": {
"dateTime": "2017-08-12T13:00:00-05:00"
},
"iCalUID": "v7kvmsvsoms3hjl5uq423jqhb0@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.v7kvmsvsoms3hjl5uq423jqhb0",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007268672000\"",
"id": "1p7fb5vob7vm57fepk4p1teft9",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MXA3ZmI1dm9iN3ZtNTdmZXBrNHAxdGVmdDkgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:27:14.000Z",
"updated": "2017-11-06T21:27:14.336Z",
"summary": "Breakfast at Tiffany's",
"location": "Tiffany's",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-06T07:00:00-06:00"
},
"end": {
"dateTime": "2017-11-06T08:00:00-06:00"
},
"iCalUID": "1p7fb5vob7vm57fepk4p1teft9@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.1p7fb5vob7vm57fepk4p1teft9",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007309018000\"",
"id": "05f5eieun35hoofbiab00ru03o",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MDVmNWVpZXVuMzVob29mYmlhYjAwcnUwM28gc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:27:34.000Z",
"updated": "2017-11-06T21:27:34.509Z",
"summary": "Lunch at Sushi House",
"location": "Sushi House",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-06T12:30:00-06:00"
},
"end": {
"dateTime": "2017-11-06T13:30:00-06:00"
},
"iCalUID": "05f5eieun35hoofbiab00ru03o@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.05f5eieun35hoofbiab00ru03o",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007516220000\"",
"id": "4hrv7chnc3jspepqr4ntrsq6k9",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NGhydjdjaG5jM2pzcGVwcXI0bnRyc3E2azkgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:29:17.000Z",
"updated": "2017-11-06T21:29:18.110Z",
"summary": "Dinner at Gia Mia",
"location": "Gia Mia",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-06T19:00:00-06:00"
},
"end": {
"dateTime": "2017-11-06T20:00:00-06:00"
},
"iCalUID": "4hrv7chnc3jspepqr4ntrsq6k9@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.4hrv7chnc3jspepqr4ntrsq6k9",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007580384000\"",
"id": "53k665tdurv5geejkl8d9eljmp",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NTNrNjY1dGR1cnY1Z2VlamtsOGQ5ZWxqbXAgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:29:50.000Z",
"updated": "2017-11-06T21:29:50.192Z",
"summary": "Breakfast at McDonald's",
"location": "McDonald's",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-09T07:00:00-06:00"
},
"end": {
"dateTime": "2017-11-09T08:00:00-06:00"
},
"iCalUID": "53k665tdurv5geejkl8d9eljmp@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.53k665tdurv5geejkl8d9eljmp",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007628078000\"",
"id": "27n9mbbabkur965n87ddir6m1i",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MjduOW1iYmFia3VyOTY1bjg3ZGRpcjZtMWkgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:30:14.000Z",
"updated": "2017-11-06T21:30:14.039Z",
"summary": "Lunch at McDonald's",
"location": "McDonald's",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-09T13:00:00-06:00"
},
"end": {
"dateTime": "2017-11-09T14:00:00-06:00"
},
"iCalUID": "27n9mbbabkur965n87ddir6m1i@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.27n9mbbabkur965n87ddir6m1i",
"reminders": {
"useDefault": true
}
},
{
"kind": "calendar#event",
"etag": "\"3020007645098000\"",
"id": "3jmu86tk17hc21gam5l073pu1k",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=M2ptdTg2dGsxN2hjMjFnYW01bDA3M3B1MWsgc3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t",
"created": "2017-11-06T21:30:22.000Z",
"updated": "2017-11-06T21:30:22.549Z",
"summary": "Dinner at McDonald's",
"location": "McDonald's",
"creator": {
"email": "support@chilkatcloud.com",
"self": true
},
"organizer": {
"email": "support@chilkatcloud.com",
"self": true
},
"start": {
"dateTime": "2017-11-09T19:00:00-06:00"
},
"end": {
"dateTime": "2017-11-09T20:00:00-06:00"
},
"iCalUID": "3jmu86tk17hc21gam5l073pu1k@google.com",
"sequence": 0,
"hangoutLink": "https://plus.google.com/hangouts/_/chilkatcloud.com/support?hceid=c3VwcG9ydEBjaGlsa2F0Y2xvdWQuY29t.3jmu86tk17hc21gam5l073pu1k",
"reminders": {
"useDefault": true
}
}
]
}