Ich versuche, Informationen aus MS Office 365 Ressource Kalender abrufen.Verständnis von Microsoft API-Antwort für Office 365
Ich verwende den unten gezeigten Code und bekomme eine Zeichenfolge zurück. Ich möchte es als JSON-Feed erhalten. oder Array, wenn JSON nicht möglich ist, da ich das Ergebnis auf einem "Vollkalender" anzeigen möchte
Wer kennt den Trick.?
Code:
$username = '[email protected]'; // User with delegate control.
$password = '[email protected]';
$calendar = '[email protected]';
$URL = 'https://outlook.office365.com/api/v1.0/users/'.$calendar.'/calendarview?startDateTime=05/30/2016&endDateTime=06/13/2016';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$result= (curl_exec ($ch));
curl_close ($ch);
echo gettype($result)."<br /><br /><br />";
print_r($result);
RESULT .:
string
{"@odata.context":"https://outlook.office365.com/api/v1.0/$metadata#Users('[email protected]')/CalendarView","value":[{"@odata.id":"https://outlook.office365.com/api/v1.0/Users('[email protected]')/Events('AAMkADBiMmM3NjE5LTUyMDUtNDY0Mi1hNjAyLTY2M2ZlYmM3OTkwOQBGAAAAAAAnzkQlYPmYQ4MtD6sjQqO8BwAaVyh143FwQZzopix2q_v7AAAAAAENAAAaVyh143FwQZzopix2q_v7AAAAAA0eAAA=')","@odata.etag":"W/\"GlcodeNxcEGc6KYsdqvr+wAAAAAMVg==\"","Id":"AAMkADBiMmM3NjE5LTUyMDUtNDY0Mi1jAyLTY2M2ZlYmM3OTkwOQBGAAAAAAAnzkQlYPmYQ4MtD6sjQqO8BwAaVyh143FwQZzopix2q_v7AAAAAAENAAAaVyh143FwQZzopix2q_v7AAAAAA0eAAA=","DateTimeCreated":"2016-06-06T12:07:57.398966Z","DateTimeLastModified":"2016-06-06T12:07:57.8833477Z","ChangeKey":"GlcodeNxcEGc6KYsdqvr+wAAAAAMVg==","Categories":[],"StartTimeZone":"Romance Standard Time","EndTimeZone":"Romance Standard Time","ResponseStatus":{"Response":"Accepted","Time":"2016-06-06T12:07:57.6489687Z"},"iCalUId" ....