79634500

Date: 2025-05-22 20:42:58
Score: 1.5
Natty:
Report link

Just to add to @dearsina answer, another, even simpler solution, is to send the following in the folder property:


$data = ['name' => 'New folder', 'folder' => ['@odata.type' => 'microsoft.graph.folder'], '@microsoft.graph.conflictBehavior' => 'rename'];

As you can see, folder doesn't necessarily has to be empty, it can have the optional '@odata.type' property, thus, you can avoid the whole issue with PHP's default interpretation of an empty array not being associative (i.e an object in json).

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @dearsina
  • Low reputation (1):
Posted by: Apparatchik