На основании моего теста я только что получил последовательные результаты.
Код:
<?php
require __DIR__.'/vendor/autoload.php';
use Microsoft\Graph\Graph;
use Microsoft\Graph\Model;
$accessToken = 'token_you_get';
// Create a Graph client
$graph = new Graph();
$graph->setAccessToken($accessToken);
$con = array(
'givenName' => 'jack',
'surname' => 'Jia',
'emailAddresses' => array(array('address'=>'jack@hanxia.onmicrosoft.com','name'=>'Jack Jia')),
'businessPhones' => array('businessPhones')
);
// echo json_encode($con);
// Create
$response = $graph->createRequest('POST','/me/contacts')
->attachBody($con)
->setReturnType(Model\Contact::class)
->execute();
//print_r($response);
print_r(json_encode($response));
?>
Вывод:
{"@odata.context":"https:\/\/graph.microsoft.com\/v1.0\/$metadata#users('ab6d4cd6-fc2d-40c7-a676-f8773aebfb5f')\/contacts\/$entity","@odata.etag":"W\/\"EQAAABYAAADFfsMkDOi6RJmdHfFRfNmxAAG\/fEFA\"","id":"AQMkADEwZjA1OGFkLTdiZmItNGVhZC1hZjU0LWNiN2E5N2Q3M2VhNwBGAAADKULPD_-h-UyldzHnJR6vNgcAxX7DJAzoukSZnR3xUXzZsQAAAgEOAAAAxX7DJAzoukSZnR3xUXzZsQABv5a9WwAAAA==","createdDateTime":"2020-02-12T16:12:44Z","lastModifiedDateTime":"2020-02-12T16:12:44Z","changeKey":"EQAAABYAAADFfsMkDOi6RJmdHfFRfNmxAAG\/fEFA","categories":[],"parentFolderId":"AQMkADEwZjA1OGFkLTdiZmItNGVhZC1hZjU0LWNiN2E5N2Q3M2VhNwAuAAADKULPD_-h-UyldzHnJR6vNgEAxX7DJAzoukSZnR3xUXzZsQAAAgEOAAAA","birthday":null,"fileAs":"","displayName":"jack Jia","givenName":"jack","initials":null,"middleName":null,"nickName":null,"surname":"Jia","title":null,"yomiGivenName":null,"yomiSurname":null,"yomiCompanyName":null,"generation":null,"imAddresses":[],"jobTitle":null,"companyName":null,"department":null,"officeLocation":null,"profession":null,"businessHomePage":null,"assistantName":null,"manager":null,"homePhones":[],"mobilePhone":null,"businessPhones":["businessPhones"],"spouseName":null,"personalNotes":"","children":[],"emailAddresses":[{"name":"Jack Jia","address":"jack@hanxia.onmicrosoft.com"}],"homeAddress":[],"businessAddress":[],"otherAddress":[]}
createdDateTime
и lastModifiedDateTime
в ответе:
"createdDateTime": "2020-02-12T16:12:44Z"
"lastModifiedDateTime": "2020-02-12T16:12:44Z"
И, с помощью Microsoft Graph Explorer, я получил следующий результат:
Вы можете увидеть что и createdDateTime
, и lastModifiedDateTime
согласуются. Не могли бы вы еще раз попробовать, если это просто временная проблема.