1

I want to create a google calendar using php api, is it possible ?

Thanks for your help.

2 Answers 2

3

Yes it is possible !

$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);

code from this page

link to doc for Calendar Insert


But it's way easier to use the Google API PHP client library

$calendar = new Calendar();
$calendar->setSummary('calendarSummary');
$calendar->setTimeZone('America/Los_Angeles');

$createdCalendar = $service->calendars->insert($calendar)
Sign up to request clarification or add additional context in comments.

Comments

2

Refer this URL, it will help you

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.html6

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.