首页 > 解决方案 > Microsoft Graph 创建联系人问题

问题描述

当我在 microsoft graph 中创建联系人时,我遇到了以下问题

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json
request-id: xxx
client-request-id: xxx
Strict-Transport-Security: max-age=31536000
Date: Fri, 29 May 2020 13:23:55 GMT
Content-Length: 315

{
  "error": {
    "code": "RequestBodyRead",
    "message": "An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartArray' node was expected.",
    "innerError": {
      "request-id": "xxxx",
      "date": "2020-05-29T13:23:55"
    }
  }
}

以下 postdata 正在发生这种情况

POST https://graph.microsoft.com/v1.0/users/xxx/contacts HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
SdkVersion: Graph-php-1.12.0
Authorization: xxxx
User-Agent: GuzzleHttp/6.5.3 curl/7.51.0 PHP/5.6.31
Content-Length: 209

{"title":"Mr.","givenName":"Eric","surname":"Klinitski","businessPhones":"30 1235436","mobilePhone":"00 49 1234 6543125","emailAddresses":[{"address":"erick@xxx.com","name":"erick@xxx.com"}]}

我正在使用我已经管理过的 PHP SDK 生成获取请求

标签: phpsdkmicrosoft-graph-api

解决方案


推荐阅读