0
votes

I have an attachment link which points to user's onedrive .

https://company-my.sharepoint.com/personal/drive_name/Documents/Microsoft Teams Chat Files/hr.pak

While I can download this file by following series of steps:

  1. Getting user's driveid

GET https://graph.microsoft.com/v1.0/users/{idOrUserPrincipalName}/drive

  1. Get items from the root drive

GET https://graph.microsoft.com/v1.0/drives/{driveId}/root/children

  1. Get items of Microsoft Team Chat Files folder

GET https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/children

  1. Download file using the value of @microsoft.graph.downloadUrl field.

Is it possible to translate the url(https://company-my.sharepoint.com/personal/drive_name/Documents/Microsoft Teams Chat Files/hr.pak) to a single graph api call to download the file?

1

1 Answers