I have got my access token but I am struggling to see how you then send the request for the data required. In the example Call Microsoft Graph they have:
GET https://graph.microsoft.com/v1.0/me/messages?$select=subject,from,receivedDateTime&$top=25&$orderby=receivedDateTime%20DESC Accept: application/json Authorization: Bearer token
But what is the method for parsing the Accept: and the Authorization: to Microsoft Graph?
I have tried as a POST but it says bearer token empty.
$token=$_SESSION['$token'];
$url = 'https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2018-02-08T18:29:54.171Z&enddatetime=2018-02-15T18:29:54.171Z';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => array(
Authorization => 'Bearer ' . $token,
Content-Type => 'application/json'
)
)
);
$resp = curl_exec($curl);
curl_close($curl);