I was looking for the same kind of solution, then I found :
You need first a user which has "owner" right to the calendar you want to create
(you can test with your admin account)
Then you need to encode in base64 your login passord
GO to this site, you can do it online
http://www.tools4noobs.com/online_php_functions/base64_encode/
then choose "base64encode"
write inside the box like this example :
john.smith@domain.com:password
Copy the result : example
am9obi5zbWl0aEBkb21haW4uY29tOnBhc3N3b3Jk
1 step : read events (in php) :
<?
$mail = "eric.blik@domain.com"; // agenda email you want to check
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Authorization: Basic am9obi5zbWl0aEBkb21haW4uY29tOnBhc3N3b3Jk"
// replace after basic by the password
)
);
$context = stream_context_create($opts);
$ret_event = file_get_contents("https://outlook.office365.com/api/v1.0/users/" . $mail . "/calendarview?startDateTime=2015-06-30T09:00:00Z&endDateTime=2015-06-30T18:00:00Z", false, $context);
echo "<pre>";
print_r(json_decode($ret_event));
echo "</pre>";
?>
2nd step : write event (in php) :
<?
$mail = "eric.blik@domain.com"; // agenda email you want ot add event
$url = "https://outlook.office365.com/api/v1.0/users/" . $mail . "/events";
$fuseau = date("P");
$titre = "Hello"; // Title
$description = "Welcome to our world"; // Content can be html
// Time zone is for France, check yours
// Change the date time for your event
$data_json = '{ "Subject": "' . $titre . '",
"Body": {
"ContentType": "HTML",
"Content": "' . $description . '"
},
"Start": "2015-07-07T18:00:00' . $fuseau . '",
"StartTimeZone": "Romance Standard Time",
"End": "2015-07-07T19:00:00' . $fuseau . '",
"EndTimeZone": "Romance Standard Time",
"Attendees": [
{
"EmailAddress": {
"Address": "' . $mail . '",
"Name": "TEST"
},
"Type": "Required"
}
]
}';
$options = array("http" => array( "method" => "POST",
"header" => "Authorization: Basic am9obi5zbWl0aEBkb21haW4uY29tOnBhc3N3b3Jk\r\n" .
"Content-type: application/json\r\n",
"content" => $data_json
));
$context = stream_context_create($options);
$retour_create_event = file_get_contents($url, false, $context);
echo "<pre>";
print_r(json_decode($retour_create_event));
echo "</pre>";
$id = json_decode($retour_create_event)->Id;
echo "Id of the event : " . $id;
?>
Now check your agenda, you will have your event
You can add a lot a settings, like categories or other information
It works as well for email, Onenote, and Sharepoint.
Waiting for your feed back