Hi,
I'm trying to upload a file to one drive through code and these are my observations while testing the API with postman.
POST url : https://graph.microsoft.com/v1.0/me/drive/items/{item-id}:/{filename}:/createUploadSession
Authorization : Bearer token added
Expected payload format from documentation :
{
"item": {
"@odata.type": "microsoft.graph.driveItemUploadableProperties",
"@microsoft.graph.conflictBehavior": "rename",
"name": "largefile.dat"
}
}
But when I call the api with payload in expected format, I receive "invalid request" as response.
When I pass payload as below: (without external curly braces)
"item": {
"@odata.type": "microsoft.graph.driveItemUploadableProperties",
"@microsoft.graph.conflictBehavior": "rename",
"name": "largefile.dat"
}
Upload session is created and required response is obtained.
With Microsoft graph explorer, in both the cases I'm not able to create upload session but I receive invalid request as response.
API works as expected when I try to create upload session with file path, but the payload problem occurs when I try to create session with item-id.
Request you to kindly look into this, fix if required and please let me know about the right approach and correct me if my understanding is wrong.
Thanks
Divya