question

AbdulkareemNalband-5248 avatar image
0 Votes"
AbdulkareemNalband-5248 asked AbdulkareemNalband-5248 commented

Create folder in root is failing with 404

We are trying to create folder in users one drive root folder

by sending following request

POST /v1.0/me/drive/root/childern HTTP/1.1
Host: graph.microsoft.com
Authorization: Bearer <snipped>
Content-Type: application/json
Content-Length: 34

{"name":"DecisionsQQ","folder":{}}


but it is failing with 404

HTTP/1.1 404 Not Found
Cache-Control: no-cache
Content-Encoding: gzip
Content-Type: application/json
Date: Tue, 12 Oct 2021 06:39:53 GMT
Strict-Transport-Security: max-age=31536000
Transfer-Encoding: chunked
Vary: Accept-Encoding
client-request-id: c0455943-6ba2-468e-a199-03d642c8a455
request-id: c0455943-6ba2-468e-a199-03d642c8a455
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"000","RoleInstance":"MA1PEPF00001F5F"}}

{
    "error": {
        "code": "itemNotFound",
        "innerError": {
            "client-request-id": "c0455943-6ba2-468e-a199-03d642c8a455",
            "date": "2021-10-12T06:39:54",
            "request-id": "c0455943-6ba2-468e-a199-03d642c8a455"
        },
        "message": "Item not found"
    }
}


microsoft-graph-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered AbdulkareemNalband-5248 commented

You have a typo in your request path. childern should be children.

 POST https://graph.microsoft.com/v1.0/me/drive/root/children
 {
     "name": "New Folder",
     "folder": {},
     "@microsoft.graph.conflictBehavior": "rename"
 }
 # Response
 {
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('2f43...')/drive/root/children/$entity",
     "createdDateTime": "2021-10-15T06:43:20Z",
     ...
 }


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.