我有我的访问令牌,但我很难看到你如何发送所需数据的请求 . 在示例Call Microsoft Graph中,他们有:
GET https://graph.microsoft.com/v1.0/me/messages?$select=subject,from,receivedDateTime&$top=25&$orderby=receivedDateTime%20DESC接受:application / json授权:Bearer token
但是解析Accept:和Authorization:to Microsoft Graph的方法是什么?
我曾尝试过POST,但它表示持有人令牌为空 .
$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);
1 回答
使用提供的graphServiceClient
用它来验证您的请求 .