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

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

 

 

 

(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_CkJsonObject.h>

void ChilkatSample(void)
    {
    HCkJsonObject 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 = CkJsonObject_Create();
    CkJsonObject_UpdateString(json,"kind","calendar#event");
    CkJsonObject_UpdateString(json,"etag","some_etag");
    CkJsonObject_UpdateString(json,"id","string value");
    CkJsonObject_UpdateString(json,"status","string value");
    CkJsonObject_UpdateString(json,"htmlLink","string value");
    CkJsonObject_UpdateString(json,"created","datetime value");
    CkJsonObject_UpdateString(json,"updated","datetime value");
    CkJsonObject_UpdateString(json,"summary","string value");
    CkJsonObject_UpdateString(json,"description","string value");
    CkJsonObject_UpdateString(json,"location","string value");
    CkJsonObject_UpdateString(json,"colorId","string value");
    CkJsonObject_UpdateString(json,"creator.id","string value");
    CkJsonObject_UpdateString(json,"creator.email","string value");
    CkJsonObject_UpdateString(json,"creator.displayName","string value");
    CkJsonObject_UpdateBool(json,"creator.self",TRUE);
    CkJsonObject_UpdateString(json,"organizer.id","string value");
    CkJsonObject_UpdateString(json,"organizer.email","string value");
    CkJsonObject_UpdateString(json,"organizer.displayName","string value");
    CkJsonObject_UpdateBool(json,"organizer.self",TRUE);
    CkJsonObject_UpdateString(json,"start.date","date value");
    CkJsonObject_UpdateString(json,"start.dateTime","datetime value");
    CkJsonObject_UpdateString(json,"start.timeZone","string value");
    CkJsonObject_UpdateString(json,"end.date","date value");
    CkJsonObject_UpdateString(json,"end.dateTime","datetime value");
    CkJsonObject_UpdateString(json,"end.timeZone","string value");
    CkJsonObject_UpdateBool(json,"endTimeUnspecified",TRUE);
    CkJsonObject_UpdateString(json,"recurrence[0]","string value");
    CkJsonObject_UpdateString(json,"recurringEventId","string value");
    CkJsonObject_UpdateString(json,"originalStartTime.date","date value");
    CkJsonObject_UpdateString(json,"originalStartTime.dateTime","datetime value");
    CkJsonObject_UpdateString(json,"originalStartTime.timeZone","string value");
    CkJsonObject_UpdateString(json,"transparency","string value");
    CkJsonObject_UpdateString(json,"visibility","string value");
    CkJsonObject_UpdateString(json,"iCalUID","string value");
    CkJsonObject_UpdateNumber(json,"sequence","1234");

    CkJsonObject_UpdateString(json,"attendees[0].id","string value");
    CkJsonObject_UpdateString(json,"attendees[0].email","string value");
    CkJsonObject_UpdateString(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_putI(json,0);
    CkJsonObject_UpdateBool(json,"attendees[i].organizer",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[i].self",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[i].resource",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[i].optional",TRUE);
    CkJsonObject_UpdateString(json,"attendees[i].responseStatus","string value");
    CkJsonObject_UpdateString(json,"attendees[i].comment","string value");
    CkJsonObject_UpdateNumber(json,"attendees[i].additionalGuests","1234");

    CkJsonObject_putI(json,1);
    CkJsonObject_UpdateString(json,"attendees[i].id","string value");
    CkJsonObject_UpdateString(json,"attendees[i].email","string value");
    CkJsonObject_UpdateString(json,"attendees[i].displayName","string value");

    CkJsonObject_UpdateBool(json,"attendees[1].organizer",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[1].self",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[1].resource",TRUE);
    CkJsonObject_UpdateBool(json,"attendees[1].optional",TRUE);
    CkJsonObject_UpdateString(json,"attendees[1].responseStatus","string value");
    CkJsonObject_UpdateString(json,"attendees[1].comment","string value");
    CkJsonObject_UpdateNumber(json,"attendees[1].additionalGuests","1234");

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

    CkJsonObject_putEmitCompact(json,FALSE);
    printf("%s\n",CkJsonObject_emit(json));


    CkJsonObject_Dispose(json);

    }

 

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