11 messages in com.googlegroups.google-calendar-help-dataapigetting php to add an event
FromSent OnAttachments
mail...@gmail.com23 May 2006 04:26 
Sanjay23 May 2006 09:11 
Francis23 May 2006 12:30 
Francis23 May 2006 14:50 
kusamochi24 May 2006 02:15 
kusamochi24 May 2006 02:56 
Francis24 May 2006 07:07 
mall...@gmail.com25 May 2006 02:04 
Francis25 May 2006 03:05 
talleyrand25 May 2006 14:40 
Francis25 May 2006 16:20 
Subject:getting php to add an event
From:mail...@gmail.com (mail@gmail.com)
Date:05/23/2006 04:26:38 AM
List:com.googlegroups.google-calendar-help-dataapi

I am trying to get my calendar updated using php ! So far I have been able to get the auth token by sending a raw http post to the login url ! When trying to create an event in the calendar using the script below

<?php $host="66.102.7.99"; $method="post"; $path="/calendar/feeds/default/private/full"; $data="<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Tennis with Beth</title> <content type='text'>Meet for a quick lesson.</content> <author> <name>Jo March</name><email>j.@gmail.com</email> </author> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:where valueString='Rolling Lawn Courts'></gd:where> <gd:when startTime='2006-05-21T15:00:00.000Z' endTime='2006-05-21T17:00:00.000Z'></gd:when> </entry>"; $method = strtoupper($method); $fp = fsockopen('ssl://'.$host,443); echo $fp; fputs($fp,"$method $path HTTP/1.1\r\n"); fputs($fp,"Host: $host\r\n"); fputs($fp,"Content-Type: application/atom+xml\r\n"); fputs($fp,"Authorization: GoogleLogin auth= DQAAAHsAAABD9GU_8cIwLttjzqMyDXx2NsJMCp9l61RERvARDJ3yHIv5UIHWx31h1xHoTv0Jf39fMA0vuZm8ubqA_CFkuELue24f0pujT58aBi1SsZvlG0QvZQWRNulMO53t2It65tmWS3P2fHq5-IuII3UNB10Yuoglsj8qBsLtOu23pcphLg\r\n");

fputs($fp, "Content-Length: " . strlen($data) . "\r\n"); fputs($fp, "Connection: Close\r\n\r\n"); fputs($fp, $data); while (!feof($fp)) { $buf .=fgets($fp); } fclose($fp); print $buf; ?> it does give me the redirect page with the redirect url as www.google.com . How do I go about getting the sessionid , so that I can POST the same request again with the sessonid as google describes in the documentation ?? Cheers Francis Pereira ps: there maybe errors in the concept adopted by me . I am on summer break and not really an expert at this !