PATCH / update masterCategories with PHP "microsoft/microsoft-graph:1.109.0" application based permi

Copper Contributor

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:


  • Calendars.ReadWrite
  • MailboxSettings.ReadWrite
  • User.ReadWrite.All

$result = $graph->createRequest("PATCH", "/users/$O365UserId/outlook/masterCategories/$this->O365CatID")

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:

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
< 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 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?

0 Replies