kiran
kiran

Reputation: 3

I am trying to upload an file to a shared folder, the folder is shared by other user , need to add an file using api,

This is the pattern url pattern i tried

POST
https://graph.microsoft.com/v1.0/drives/{shareduserdriveid}/items/{shareduserFolderitemId}, 

{
  "name": "Team Documents",
  "remoteItem": {

      "parentReference": { "driveId": "sharedusersdriveid" }
  }
}

Can someone please provide right url and body pattern for adding or uploading an file to a existing shared folder

Upvotes: 0

Views: 88

Answers (1)

Kashif Tahir
Kashif Tahir

Reputation: 311

You need to POST to the children collection, so a url like the one below should work:

POST https://graph.microsoft.com/v1.0/drives/{shareduserdriveid}/items/{shareduserFolderitemId}/children

{
"name":"test.txt",
"file": {}
}

Upvotes: 1

Related Questions