0

Shared with me API provides me the list of all files and folders that are shared by internal and external users. The Shared API URL is mentioned below https://learn.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0&tabs=http

But when I try to access the shared DriveItem resource of the file that has been shared by the external user bypassing DriveID and File ID into the API /drives/{remoteItem-driveId}/items/{remoteItem-id} The API throws an error as -

{
"error": {
"code": "itemNotFound",
"message": "Item not found",
"innerError": {
"date": "2020-10-20T12:07:39",
"request-id": "5a3b3836-fe3e-450a-837e-1b3e962ac94b",
"client-request-id": "5a3b3836-fe3e-450a-837e-1b3e962ac94b"
}
}
}

But the Same API works fine with the file shared with Internal Users. Am I missing something here any help is greatly appreciated?

Regards, Kuldeep K

Dev
  • 2,428
  • 2
  • 14
  • 15

2 Answers2

0

For external tenants make sure you append ?allowexternal=true according to the public document and then give a try.

Shiva Keshav Varma
  • 3,398
  • 2
  • 9
  • 13
0

I had the same problem when trying to get workbook info from an excel made by a colleague. I was initially using

https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets

and fixed it using:

GET /drives/{remoteItem-driveId}/items/{remoteItem-id}/workbook/worksheets

The drive ID is under "parent reference" and in my case, the remote ID under "remoteItem" was the same as the first id listed.

Leah P
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – santamanno Jan 15 '23 at 23:24