Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PureBasic) Google Calendar -- Generate Event JSONSee more Google Calendar ExamplesDemonstrates how to generate the JSON for an event resource. This code can be used as a template for generating JSON to insert new events. See https://developers.google.com/google-apps/calendar/v3/reference/events#resource for details about the Calender Event Resource JSON.
IncludeFile "CkJsonObject.pb" Procedure ChilkatExample() ; This example (below) generates the following JSON: ; Note: Your application code would construct the event JSON using your ; desired subset of members. For boolean values, you would pass 1 or 0. ; For date or date/time values, you would pass the appropriately formatted date/time string. ; { ; "kind": "calendar#event", ; "etag": "some_etag", ; "id": "string value", ; "status": "string value", ; "htmlLink": "string value", ; "created": "datetime value", ; "updated": "datetime value", ; "summary": "string value", ; "description": "string value", ; "location": "string value", ; "colorId": "string value", ; "creator": { ; "id": "string value", ; "email": "string value", ; "displayName": "string value", ; "self": true ; }, ; "organizer": { ; "id": "string value", ; "email": "string value", ; "displayName": "string value", ; "self": true ; }, ; "start": { ; "date": "date value", ; "dateTime": "datetime value", ; "timeZone": "string value" ; }, ; "end": { ; "date": "date value", ; "dateTime": "datetime value", ; "timeZone": "string value" ; }, ; "endTimeUnspecified": true, ; "recurrence": [ ; "string value" ; ], ; "recurringEventId": "string value", ; "originalStartTime": { ; "date": "date value", ; "dateTime": "datetime value", ; "timeZone": "string value" ; }, ; "transparency": "string value", ; "visibility": "string value", ; "iCalUID": "string value", ; "sequence": 1234, ; "attendees": [ ; { ; "id": "string value", ; "email": "string value", ; "displayName": "string value", ; "organizer": true, ; "self": true, ; "resource": true, ; "optional": true, ; "responseStatus": "string value", ; "comment": "string value", ; "additionalGuests": 1234 ; }, ; { ; "id": "string value", ; "email": "string value", ; "displayName": "string value", ; "organizer": true, ; "self": true, ; "resource": true, ; "optional": true, ; "responseStatus": "string value", ; "comment": "string value", ; "additionalGuests": 1234 ; } ; ], ; "attendeesOmitted": true, ; "extendedProperties": { ; "private": { ; "someKey": "string value" ; }, ; "shared": { ; "someKey": "string value" ; } ; }, ; "hangoutLink": "string value", ; "gadget": { ; "type": "string value", ; "title": "string value", ; "link": "string value", ; "iconLink": "string value", ; "width": 1234, ; "height": 1234, ; "display": "string value", ; "preferences": { ; "someKey": "string value" ; } ; }, ; "anyoneCanAddSelf": true, ; "guestsCanInviteOthers": true, ; "guestsCanModify": true, ; "guestsCanSeeOtherGuests": true, ; "privateCopy": true, ; "locked": true, ; "reminders": { ; "useDefault": true, ; "overrides": [ ; { ; "method": "string value", ; "minutes": 1234 ; } ; ] ; }, ; "source": { ; "url": "string value", ; "title": "string value" ; }, ; "attachments": [ ; { ; "fileUrl": "string value", ; "title": "string value", ; "mimeType": "string value", ; "iconLink": "string value", ; "fileId": "string value" ; }, ; { ; "fileUrl": "string value", ; "title": "string value", ; "mimeType": "string value", ; "iconLink": "string value", ; "fileId": "string value" ; } ; ] ; } json.i = CkJsonObject::ckCreate() If json.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkJsonObject::ckUpdateString(json,"kind","calendar#event") CkJsonObject::ckUpdateString(json,"etag","some_etag") CkJsonObject::ckUpdateString(json,"id","string value") CkJsonObject::ckUpdateString(json,"status","string value") CkJsonObject::ckUpdateString(json,"htmlLink","string value") CkJsonObject::ckUpdateString(json,"created","datetime value") CkJsonObject::ckUpdateString(json,"updated","datetime value") CkJsonObject::ckUpdateString(json,"summary","string value") CkJsonObject::ckUpdateString(json,"description","string value") CkJsonObject::ckUpdateString(json,"location","string value") CkJsonObject::ckUpdateString(json,"colorId","string value") CkJsonObject::ckUpdateString(json,"creator.id","string value") CkJsonObject::ckUpdateString(json,"creator.email","string value") CkJsonObject::ckUpdateString(json,"creator.displayName","string value") CkJsonObject::ckUpdateBool(json,"creator.self",1) CkJsonObject::ckUpdateString(json,"organizer.id","string value") CkJsonObject::ckUpdateString(json,"organizer.email","string value") CkJsonObject::ckUpdateString(json,"organizer.displayName","string value") CkJsonObject::ckUpdateBool(json,"organizer.self",1) CkJsonObject::ckUpdateString(json,"start.date","date value") CkJsonObject::ckUpdateString(json,"start.dateTime","datetime value") CkJsonObject::ckUpdateString(json,"start.timeZone","string value") CkJsonObject::ckUpdateString(json,"end.date","date value") CkJsonObject::ckUpdateString(json,"end.dateTime","datetime value") CkJsonObject::ckUpdateString(json,"end.timeZone","string value") CkJsonObject::ckUpdateBool(json,"endTimeUnspecified",1) CkJsonObject::ckUpdateString(json,"recurrence[0]","string value") CkJsonObject::ckUpdateString(json,"recurringEventId","string value") CkJsonObject::ckUpdateString(json,"originalStartTime.date","date value") CkJsonObject::ckUpdateString(json,"originalStartTime.dateTime","datetime value") CkJsonObject::ckUpdateString(json,"originalStartTime.timeZone","string value") CkJsonObject::ckUpdateString(json,"transparency","string value") CkJsonObject::ckUpdateString(json,"visibility","string value") CkJsonObject::ckUpdateString(json,"iCalUID","string value") CkJsonObject::ckUpdateNumber(json,"sequence","1234") CkJsonObject::ckUpdateString(json,"attendees[0].id","string value") CkJsonObject::ckUpdateString(json,"attendees[0].email","string value") CkJsonObject::ckUpdateString(json,"attendees[0].displayName","string value") ; Note: We could alternately specify an index using "i", which allows ; for an application to construct using a loop with a variable.. CkJsonObject::setCkI(json, 0) CkJsonObject::ckUpdateBool(json,"attendees[i].organizer",1) CkJsonObject::ckUpdateBool(json,"attendees[i].self",1) CkJsonObject::ckUpdateBool(json,"attendees[i].resource",1) CkJsonObject::ckUpdateBool(json,"attendees[i].optional",1) CkJsonObject::ckUpdateString(json,"attendees[i].responseStatus","string value") CkJsonObject::ckUpdateString(json,"attendees[i].comment","string value") CkJsonObject::ckUpdateNumber(json,"attendees[i].additionalGuests","1234") CkJsonObject::setCkI(json, 1) CkJsonObject::ckUpdateString(json,"attendees[i].id","string value") CkJsonObject::ckUpdateString(json,"attendees[i].email","string value") CkJsonObject::ckUpdateString(json,"attendees[i].displayName","string value") CkJsonObject::ckUpdateBool(json,"attendees[1].organizer",1) CkJsonObject::ckUpdateBool(json,"attendees[1].self",1) CkJsonObject::ckUpdateBool(json,"attendees[1].resource",1) CkJsonObject::ckUpdateBool(json,"attendees[1].optional",1) CkJsonObject::ckUpdateString(json,"attendees[1].responseStatus","string value") CkJsonObject::ckUpdateString(json,"attendees[1].comment","string value") CkJsonObject::ckUpdateNumber(json,"attendees[1].additionalGuests","1234") CkJsonObject::ckUpdateBool(json,"attendeesOmitted",1) CkJsonObject::ckUpdateString(json,"extendedProperties.private.someKey","string value") CkJsonObject::ckUpdateString(json,"extendedProperties.shared.someKey","string value") CkJsonObject::ckUpdateString(json,"hangoutLink","string value") CkJsonObject::ckUpdateString(json,"gadget.type","string value") CkJsonObject::ckUpdateString(json,"gadget.title","string value") CkJsonObject::ckUpdateString(json,"gadget.link","string value") CkJsonObject::ckUpdateString(json,"gadget.iconLink","string value") CkJsonObject::ckUpdateNumber(json,"gadget.width","1234") CkJsonObject::ckUpdateNumber(json,"gadget.height","1234") CkJsonObject::ckUpdateString(json,"gadget.display","string value") CkJsonObject::ckUpdateString(json,"gadget.preferences.someKey","string value") CkJsonObject::ckUpdateBool(json,"anyoneCanAddSelf",1) CkJsonObject::ckUpdateBool(json,"guestsCanInviteOthers",1) CkJsonObject::ckUpdateBool(json,"guestsCanModify",1) CkJsonObject::ckUpdateBool(json,"guestsCanSeeOtherGuests",1) CkJsonObject::ckUpdateBool(json,"privateCopy",1) CkJsonObject::ckUpdateBool(json,"locked",1) CkJsonObject::ckUpdateBool(json,"reminders.useDefault",1) CkJsonObject::ckUpdateString(json,"reminders.overrides[0].method","string value") CkJsonObject::ckUpdateNumber(json,"reminders.overrides[0].minutes","1234") CkJsonObject::ckUpdateString(json,"source.url","string value") CkJsonObject::ckUpdateString(json,"source.title","string value") CkJsonObject::ckUpdateString(json,"attachments[0].fileUrl","string value") CkJsonObject::ckUpdateString(json,"attachments[0].title","string value") CkJsonObject::ckUpdateString(json,"attachments[0].mimeType","string value") CkJsonObject::ckUpdateString(json,"attachments[0].iconLink","string value") CkJsonObject::ckUpdateString(json,"attachments[0].fileId","string value") CkJsonObject::ckUpdateString(json,"attachments[1].fileUrl","string value") CkJsonObject::ckUpdateString(json,"attachments[1].title","string value") CkJsonObject::ckUpdateString(json,"attachments[1].mimeType","string value") CkJsonObject::ckUpdateString(json,"attachments[1].iconLink","string value") CkJsonObject::ckUpdateString(json,"attachments[1].fileId","string value") CkJsonObject::setCkEmitCompact(json, 0) Debug CkJsonObject::ckEmit(json) CkJsonObject::ckDispose(json) ProcedureReturn EndProcedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.