我想使用php api创建google calendar
,是否可能?
感谢您的帮助。
答案 0 :(得分:3)
是的,这是可能的!
$url = 'http://www.googleapis.com/calendar/v3/calendars';
$data = array(
'summary' => 'MyNewCalendarTitle'
);
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
link to doc for Calendar Insert
但使用Google API PHP client library
更容易$calendar = new Calendar();
$calendar->setSummary('calendarSummary');
$calendar->setTimeZone('America/Los_Angeles');
$createdCalendar = $service->calendars->insert($calendar)
答案 1 :(得分:2)
请参阅此网址,它会对您有所帮助
https://developers.google.com/google-apps/calendar/v1/developers_guide_php
https://developers.google.com/google-apps/calendar/
http://www.sanisoft.com/blog/2010/04/26/howto-google-calendar-api-php/
http://googleappsdeveloper.blogspot.in/2010/09/new-json-format-for-google-calendar-api.html
http://mark.biek.org/blog/2010/07/addingdeleting-events-with-the-google-calendar-api/
http://www.phpclasses.org/package/7420-PHP-Generate-links-to-add-events-to-Google-Calendar.html 6