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
(DataFlex) 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.
Use ChilkatAx-win32.pkg Procedure Test Handle hoJson Boolean iSuccess String sTemp1 // 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 True or False. // 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" // } // ] // } Get Create (RefClass(cComChilkatJsonObject)) To hoJson If (Not(IsComObjectCreated(hoJson))) Begin Send CreateComObject of hoJson End Get ComUpdateString Of hoJson "kind" "calendar#event" To iSuccess Get ComUpdateString Of hoJson "etag" "some_etag" To iSuccess Get ComUpdateString Of hoJson "id" "string value" To iSuccess Get ComUpdateString Of hoJson "status" "string value" To iSuccess Get ComUpdateString Of hoJson "htmlLink" "string value" To iSuccess Get ComUpdateString Of hoJson "created" "datetime value" To iSuccess Get ComUpdateString Of hoJson "updated" "datetime value" To iSuccess Get ComUpdateString Of hoJson "summary" "string value" To iSuccess Get ComUpdateString Of hoJson "description" "string value" To iSuccess Get ComUpdateString Of hoJson "location" "string value" To iSuccess Get ComUpdateString Of hoJson "colorId" "string value" To iSuccess Get ComUpdateString Of hoJson "creator.id" "string value" To iSuccess Get ComUpdateString Of hoJson "creator.email" "string value" To iSuccess Get ComUpdateString Of hoJson "creator.displayName" "string value" To iSuccess Get ComUpdateBool Of hoJson "creator.self" True To iSuccess Get ComUpdateString Of hoJson "organizer.id" "string value" To iSuccess Get ComUpdateString Of hoJson "organizer.email" "string value" To iSuccess Get ComUpdateString Of hoJson "organizer.displayName" "string value" To iSuccess Get ComUpdateBool Of hoJson "organizer.self" True To iSuccess Get ComUpdateString Of hoJson "start.date" "date value" To iSuccess Get ComUpdateString Of hoJson "start.dateTime" "datetime value" To iSuccess Get ComUpdateString Of hoJson "start.timeZone" "string value" To iSuccess Get ComUpdateString Of hoJson "end.date" "date value" To iSuccess Get ComUpdateString Of hoJson "end.dateTime" "datetime value" To iSuccess Get ComUpdateString Of hoJson "end.timeZone" "string value" To iSuccess Get ComUpdateBool Of hoJson "endTimeUnspecified" True To iSuccess Get ComUpdateString Of hoJson "recurrence[0]" "string value" To iSuccess Get ComUpdateString Of hoJson "recurringEventId" "string value" To iSuccess Get ComUpdateString Of hoJson "originalStartTime.date" "date value" To iSuccess Get ComUpdateString Of hoJson "originalStartTime.dateTime" "datetime value" To iSuccess Get ComUpdateString Of hoJson "originalStartTime.timeZone" "string value" To iSuccess Get ComUpdateString Of hoJson "transparency" "string value" To iSuccess Get ComUpdateString Of hoJson "visibility" "string value" To iSuccess Get ComUpdateString Of hoJson "iCalUID" "string value" To iSuccess Get ComUpdateNumber Of hoJson "sequence" "1234" To iSuccess Get ComUpdateString Of hoJson "attendees[0].id" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[0].email" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[0].displayName" "string value" To iSuccess // Note: We could alternately specify an index using "i", which allows // for an application to construct using a loop with a variable.. Set ComI Of hoJson To 0 Get ComUpdateBool Of hoJson "attendees[i].organizer" True To iSuccess Get ComUpdateBool Of hoJson "attendees[i].self" True To iSuccess Get ComUpdateBool Of hoJson "attendees[i].resource" True To iSuccess Get ComUpdateBool Of hoJson "attendees[i].optional" True To iSuccess Get ComUpdateString Of hoJson "attendees[i].responseStatus" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[i].comment" "string value" To iSuccess Get ComUpdateNumber Of hoJson "attendees[i].additionalGuests" "1234" To iSuccess Set ComI Of hoJson To 1 Get ComUpdateString Of hoJson "attendees[i].id" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[i].email" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[i].displayName" "string value" To iSuccess Get ComUpdateBool Of hoJson "attendees[1].organizer" True To iSuccess Get ComUpdateBool Of hoJson "attendees[1].self" True To iSuccess Get ComUpdateBool Of hoJson "attendees[1].resource" True To iSuccess Get ComUpdateBool Of hoJson "attendees[1].optional" True To iSuccess Get ComUpdateString Of hoJson "attendees[1].responseStatus" "string value" To iSuccess Get ComUpdateString Of hoJson "attendees[1].comment" "string value" To iSuccess Get ComUpdateNumber Of hoJson "attendees[1].additionalGuests" "1234" To iSuccess Get ComUpdateBool Of hoJson "attendeesOmitted" True To iSuccess Get ComUpdateString Of hoJson "extendedProperties.private.someKey" "string value" To iSuccess Get ComUpdateString Of hoJson "extendedProperties.shared.someKey" "string value" To iSuccess Get ComUpdateString Of hoJson "hangoutLink" "string value" To iSuccess Get ComUpdateString Of hoJson "gadget.type" "string value" To iSuccess Get ComUpdateString Of hoJson "gadget.title" "string value" To iSuccess Get ComUpdateString Of hoJson "gadget.link" "string value" To iSuccess Get ComUpdateString Of hoJson "gadget.iconLink" "string value" To iSuccess Get ComUpdateNumber Of hoJson "gadget.width" "1234" To iSuccess Get ComUpdateNumber Of hoJson "gadget.height" "1234" To iSuccess Get ComUpdateString Of hoJson "gadget.display" "string value" To iSuccess Get ComUpdateString Of hoJson "gadget.preferences.someKey" "string value" To iSuccess Get ComUpdateBool Of hoJson "anyoneCanAddSelf" True To iSuccess Get ComUpdateBool Of hoJson "guestsCanInviteOthers" True To iSuccess Get ComUpdateBool Of hoJson "guestsCanModify" True To iSuccess Get ComUpdateBool Of hoJson "guestsCanSeeOtherGuests" True To iSuccess Get ComUpdateBool Of hoJson "privateCopy" True To iSuccess Get ComUpdateBool Of hoJson "locked" True To iSuccess Get ComUpdateBool Of hoJson "reminders.useDefault" True To iSuccess Get ComUpdateString Of hoJson "reminders.overrides[0].method" "string value" To iSuccess Get ComUpdateNumber Of hoJson "reminders.overrides[0].minutes" "1234" To iSuccess Get ComUpdateString Of hoJson "source.url" "string value" To iSuccess Get ComUpdateString Of hoJson "source.title" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[0].fileUrl" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[0].title" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[0].mimeType" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[0].iconLink" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[0].fileId" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[1].fileUrl" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[1].title" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[1].mimeType" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[1].iconLink" "string value" To iSuccess Get ComUpdateString Of hoJson "attachments[1].fileId" "string value" To iSuccess Set ComEmitCompact Of hoJson To False Get ComEmit Of hoJson To sTemp1 Showln sTemp1 End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.