Hi Salesnav
I have not actually worked with the Google Calendar API, but have done a lot with the DriveApi. To be fair to Google, I think their docs make it pretty easy to do this kind of thing, but when I do it in my OAuth/REST courses I direct my students to the Google API Explorer (I'm deliberately not including a link to that, because every time I need it - as in those courses - I just Google it! <g>). From there I just go to the API I want (the one I use in the course is the Drive API, but I'm a bit behind and the current version is v3, so I click the "All Versions" link on the left and pick the Drive v2 one I am familiar with). You would want the Calendar API. Then I think you want the calendar.events.insert method, so click on that, put in your gmail address (Note: I use mjpeat@gmail.com day to day, but signed up as mjpeat@googlemail.com originally, and that's the one it wants) , the start and end (Note: they are the wrong way round, logically, being lexically sorted: "e" before "s") dates (or dateTimes), maybe another property below, say description, then click the "Authorize and execute".
It will then show you the JSON request to send to do that and the response you will get back. Example (I just did this):
Code:
Request
POST https://www.googleapis.com/calendar/v3/calendars/mjpeat%40gmail.com/events?key={YOUR_API_KEY} {
"end": {
"date": "2017-07-14"
},
"start": {
"date": "2017-07-13"
},
"description": "AcccuServ meeting at Unicorn"
}
Response
200 - Show headers -
{
"kind": "calendar#event",
"etag": "\"2999690546402000\"",
"id": "90v06b6vkmc1g51nfiirl2o454",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/even...TQgbWpwZWF0QG0",
"created": "2017-07-12T07:41:13.000Z",
"updated": "2017-07-12T07:41:13.253Z",
"description": "AcccuServ meeting at Unicorn",
"creator": {
"email": "mjpeat@gmail.com",
"displayName": "Mike Peat",
"self": true
},
"organizer": {
"email": "mjpeat@gmail.com",
"displayName": "Mike Peat",
"self": true
},
"start": {
"date": "2017-07-13"
},
"end": {
"date": "2017-07-14"
},
"iCalUID": "90v06b6vkmc1g51nfiirl2o454@google.com",
"sequence": 0,
"reminders": {
"useDefault": false,
"overrides": [
{
"method": "email",
"minutes": 10
},
{
"method": "popup",
"minutes": 30
}
]
}
}
Can I ask what version of DataFlex you are using? IMO v19.0 makes this much easier, because of the cJsonObjects it introduces (Thanks Harm! <g>).
Mike