Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Unicode C Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Unicode C) Google Calendar -- Generate Event JSON

See more Google Calendar Examples

Demonstrates 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.

Chilkat C/C++ Library Downloads

MS Visual C/C++

Linux/CentOS C/C++

Alpine Linux C/C++

MAC OS X C/C++

armhf/aarch64 C/C++

C++ Builder

iOS C/C++

Android C/C++

Solaris C/C++

MinGW C/C++

#include <C_CkJsonObjectW.h>

void ChilkatSample(void)
    {
    HCkJsonObjectW json;

    // 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"
    //     }
    //   ]
    // }

    json = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(json,L"kind",L"calendar#event");
    CkJsonObjectW_UpdateString(json,L"etag",L"some_etag");
    CkJsonObjectW_UpdateString(json,L"id",L"string value");
    CkJsonObjectW_UpdateString(json,L"status",L"string value");
    CkJsonObjectW_UpdateString(json,L"htmlLink",L"string value");
    CkJsonObjectW_UpdateString(json,L"created",L"datetime value");
    CkJsonObjectW_UpdateString(json,L"updated",L"datetime value");
    CkJsonObjectW_UpdateString(json,L"summary",L"string value");
    CkJsonObjectW_UpdateString(json,L"description",L"string value");
    CkJsonObjectW_UpdateString(json,L"location",L"string value");
    CkJsonObjectW_UpdateString(json,L"colorId",L"string value");
    CkJsonObjectW_UpdateString(json,L"creator.id",L"string value");
    CkJsonObjectW_UpdateString(json,L"creator.email",L"string value");
    CkJsonObjectW_UpdateString(json,L"creator.displayName",L"string value");
    CkJsonObjectW_UpdateBool(json,L"creator.self",TRUE);
    CkJsonObjectW_UpdateString(json,L"organizer.id",L"string value");
    CkJsonObjectW_UpdateString(json,L"organizer.email",L"string value");
    CkJsonObjectW_UpdateString(json,L"organizer.displayName",L"string value");
    CkJsonObjectW_UpdateBool(json,L"organizer.self",TRUE);
    CkJsonObjectW_UpdateString(json,L"start.date",L"date value");
    CkJsonObjectW_UpdateString(json,L"start.dateTime",L"datetime value");
    CkJsonObjectW_UpdateString(json,L"start.timeZone",L"string value");
    CkJsonObjectW_UpdateString(json,L"end.date",L"date value");
    CkJsonObjectW_UpdateString(json,L"end.dateTime",L"datetime value");
    CkJsonObjectW_UpdateString(json,L"end.timeZone",L"string value");
    CkJsonObjectW_UpdateBool(json,L"endTimeUnspecified",TRUE);
    CkJsonObjectW_UpdateString(json,L"recurrence[0]",L"string value");
    CkJsonObjectW_UpdateString(json,L"recurringEventId",L"string value");
    CkJsonObjectW_UpdateString(json,L"originalStartTime.date",L"date value");
    CkJsonObjectW_UpdateString(json,L"originalStartTime.dateTime",L"datetime value");
    CkJsonObjectW_UpdateString(json,L"originalStartTime.timeZone",L"string value");
    CkJsonObjectW_UpdateString(json,L"transparency",L"string value");
    CkJsonObjectW_UpdateString(json,L"visibility",L"string value");
    CkJsonObjectW_UpdateString(json,L"iCalUID",L"string value");
    CkJsonObjectW_UpdateNumber(json,L"sequence",L"1234");

    CkJsonObjectW_UpdateString(json,L"attendees[0].id",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[0].email",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[0].displayName",L"string value");

    // Note: We could alternately specify an index using "i", which allows
    // for an application to construct using a loop with a variable..
    CkJsonObjectW_putI(json,0);
    CkJsonObjectW_UpdateBool(json,L"attendees[i].organizer",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[i].self",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[i].resource",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[i].optional",TRUE);
    CkJsonObjectW_UpdateString(json,L"attendees[i].responseStatus",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[i].comment",L"string value");
    CkJsonObjectW_UpdateNumber(json,L"attendees[i].additionalGuests",L"1234");

    CkJsonObjectW_putI(json,1);
    CkJsonObjectW_UpdateString(json,L"attendees[i].id",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[i].email",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[i].displayName",L"string value");

    CkJsonObjectW_UpdateBool(json,L"attendees[1].organizer",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[1].self",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[1].resource",TRUE);
    CkJsonObjectW_UpdateBool(json,L"attendees[1].optional",TRUE);
    CkJsonObjectW_UpdateString(json,L"attendees[1].responseStatus",L"string value");
    CkJsonObjectW_UpdateString(json,L"attendees[1].comment",L"string value");
    CkJsonObjectW_UpdateNumber(json,L"attendees[1].additionalGuests",L"1234");

    CkJsonObjectW_UpdateBool(json,L"attendeesOmitted",TRUE);
    CkJsonObjectW_UpdateString(json,L"extendedProperties.private.someKey",L"string value");
    CkJsonObjectW_UpdateString(json,L"extendedProperties.shared.someKey",L"string value");
    CkJsonObjectW_UpdateString(json,L"hangoutLink",L"string value");
    CkJsonObjectW_UpdateString(json,L"gadget.type",L"string value");
    CkJsonObjectW_UpdateString(json,L"gadget.title",L"string value");
    CkJsonObjectW_UpdateString(json,L"gadget.link",L"string value");
    CkJsonObjectW_UpdateString(json,L"gadget.iconLink",L"string value");
    CkJsonObjectW_UpdateNumber(json,L"gadget.width",L"1234");
    CkJsonObjectW_UpdateNumber(json,L"gadget.height",L"1234");
    CkJsonObjectW_UpdateString(json,L"gadget.display",L"string value");
    CkJsonObjectW_UpdateString(json,L"gadget.preferences.someKey",L"string value");
    CkJsonObjectW_UpdateBool(json,L"anyoneCanAddSelf",TRUE);
    CkJsonObjectW_UpdateBool(json,L"guestsCanInviteOthers",TRUE);
    CkJsonObjectW_UpdateBool(json,L"guestsCanModify",TRUE);
    CkJsonObjectW_UpdateBool(json,L"guestsCanSeeOtherGuests",TRUE);
    CkJsonObjectW_UpdateBool(json,L"privateCopy",TRUE);
    CkJsonObjectW_UpdateBool(json,L"locked",TRUE);
    CkJsonObjectW_UpdateBool(json,L"reminders.useDefault",TRUE);
    CkJsonObjectW_UpdateString(json,L"reminders.overrides[0].method",L"string value");
    CkJsonObjectW_UpdateNumber(json,L"reminders.overrides[0].minutes",L"1234");
    CkJsonObjectW_UpdateString(json,L"source.url",L"string value");
    CkJsonObjectW_UpdateString(json,L"source.title",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[0].fileUrl",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[0].title",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[0].mimeType",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[0].iconLink",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[0].fileId",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[1].fileUrl",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[1].title",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[1].mimeType",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[1].iconLink",L"string value");
    CkJsonObjectW_UpdateString(json,L"attachments[1].fileId",L"string value");

    CkJsonObjectW_putEmitCompact(json,FALSE);
    wprintf(L"%s\n",CkJsonObjectW_emit(json));


    CkJsonObjectW_Dispose(json);

    }

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.