Nov 06 2023 10:55 PM - edited Nov 06 2023 10:56 PM
I'm working with PHP "microsoft/microsoft-graph:1.109.0" API 1.0 and have problems to update/PATCH `masterCategories`. Creating & delete works just fine. Updating/PATCH answers with a 200er status, but never updates a record. I use application based permissions (no /me URL) and followings are set:
$result = $graph->createRequest("PATCH", "/users/$O365UserId/outlook/masterCategories/$this->O365CatID")
->attachBody($requestBody)
->execute();
I've tried passing in an array directly or with an new OutlookCategory([array]), also tried with setters etc. to no avail.
If I hack ['debug' => true] into GraphRequest:322 I see the request like this:
PATCH /v1.0/users/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/outlook/masterCategories/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
SdkVersion: Graph-php-1.109.0
Authorization: Bearer ...
User-Agent: GuzzleHttp/7
Content-Length: 40
< HTTP/1.1 200 OK
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8
< Strict-Transport-Security: max-age=31536000
< request-id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
< client-request-id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXxxxx
< x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"004","RoleInstance":"FR2PEPF00000413"}}
< Date: Mon, 06 Nov 2023 16:03:35 GMT
<
* Connection #0 to host graph.microsoft.com left intact
result looks like:
$result->_httpStatusCode 200
$result->_request->requestBody: {"displayName":"3091","color":"preset1"}
$result->_decodedBody: {"@odata.context":"...","id":"...","displayName":"3078","color":"preset1"}
But displayName is never updated to the requested value (3091). Where did I go wrong or how is a successful PATCH request made?