I’m using a script that create events with something like that:
$data = "<entry xmlns='http://www.w3.org/2005/Atom' " .
"xmlns:gd='http://schemas.google.com/g/2005'>\n" .
"<category scheme='http://schemas.google.com/g/2005#kind' " .
"term='http://schemas.google.com/g/2005#event'></category>\n" .
"<title type='text'>event title</title>\n" .
"<content type='text'>event description</content>\n" .
"<gd:transparency value='http://schemas.google.com/g/2005#event.opaque'>" .
"</gd:transparency>\n" .
"<gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'>" .
"</gd:eventStatus>\n" .
"<gd:where valueString='event address'></gd:where>" .
"<gd:when startTime='$date"."T$timestart:00.000+01:00' endTime='$date"."T$timeend:00.000+01:00'></gd:when>\n" .
"</entry>\n";
curl_setopt($cs, CURLOPT_URL, "https://www.google.com/calendar/feeds/default/private/full");
curl_setopt($cs, CURLOPT_POST, 1);
curl_setopt($cs,CURLOPT_HTTPHEADER,array('Accept: text/html,application/xhtml+xml,application/xml'));
curl_setopt($cs, CURLOPT_HEADER, 1);
curl_setopt($cs, CURLOPT_HTTPHEADER, $httpheader);
curl_setopt($cs, CURLOPT_POSTFIELDS, $data);
I can get the event ID but I don’t know how to delete it then.
Thanks
I assume you are using the V2 API, so according to the documentation:
So, first perform a GET request to grab the event you want, grab the edit link from the XML e.g.
<link rel='edit' type='application/atom+xml'href='https://www.google.com/calendar/feeds/jo@gmail.com/private-magicCookie/full/entryID'></link>
Then use CURL to perform a DELETE request to that URL. To find out more about that, see this page which explains to use the
CURLOPT_CUSTOMREQUESToption.