Function for creating an event to GoogleCalendar.
- // eventname Tennis with John
- // month April
- // date 11
- // time 3pm-3:30pm
- void createEventInGoogle(string eventname,string month,int date,string time)
- {
- // Generating Auth Token
- GoogleAuthToken = thisapp.getGoogleAuthToken("xxxx@gmail.com", "yyyy","cl");
- // HeaderParams Included
- headerMap = { "Authorization" : "GoogleLogin auth=\"" + GoogleAuthToken + "\"", "Content-Type" : ("application/atom+xml") };
- event = eventname+" "+month+" "+date+" "+time;
- // XMLCalendarData Generating
- xmlCalendarData = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gCal='http://schemas.google.com/gCal/2005'><content type='html'>"+event+"</content><gCal:quickadd value='true'/></entry>";
- // Creating an event to GoogleCalendar
- result = postUrl("https://www.google.com/calendar/feeds/default/private/full", xmlCalendarData, headerMap,false);
- info "Response Text " + result.get("responseText");
- info "Response Code " + result.get("responseCode");
- }
Please see the below sample application for your reference.
Thanks,
Saranya