I use the following code to make a new folder using the microsoft graph api:
$tokenCache = new TokenCache();
$accessToken = $tokenCache->getAccessToken();
$graph = new Graph();
$graph->setAccessToken($accessToken);
$queryParams = array(
'name' => 'nameOfnewFolder',
'folder' => new \stdClass(),
'microsoft.graph.conflictBehavior' => 'rename'
);
$url = '/me/drive/root/children?' . http_build_query($queryParams);
return $this->graph->createRequest('POST', $url)
->setReturnType(Model\DriveItem::class)
->execute();
This returns the following error:
Empty Payload. JSON content expected.
What am I doing wrong here?