place play
place play

Reputation: 3

unable to retrieve the contents of files in the SPO document library

URL: https://graph.microsoft.com/v1.0/sites/siteid/drive/items/root:/drivename/filename:/content

Requesting this URL with GET, we were able to retrieve the contents of the file. (Confirmed around ~October 2020) The cause is unknown, as it could not be retrieved when run in Graph Explorer and no error code was returned. Response "- 0 - 336ms"

I was executing the request in swift, but the code has not been changed since the process of acquiring the file contents was successful.

Access Permissions

Access Permissions

Upvotes: 0

Views: 48

Answers (1)

Mehtab Siddique
Mehtab Siddique

Reputation: 655

The permissions required for retrieving the list of drive items , Please refer this document Permissions.

To get the file and contents of the file , please follow this API's

GET https://graph.microsoft.com/v1.0/drives/{drive-id}/items/root/children

Or if you want to list the items in a sub-folder:

GET https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}/children

Please refer this document List Contents

Upvotes: 0

Related Questions