Hi SimonT,
Thanks for reaching out!
To do operations like getting specific files on users OneDrive.
I suggest looking into the Graph API as follows:
Get information about the user's drive:
GET https://graph.microsoft.com/v1.0/me/drive
Get the root folder of the drive:
GET https://graph.microsoft.com/v1.0/me/drive/root
To see the files that are in the folder:
GET https://graph.microsoft.com/v1.0/me/drive/root/children
To download a file by ID:
GET https://graph.microsoft.com/v1.0/me/drive/items/{item-id}/content
To share files from MS OneDrive to a user via MS graph API. And user can view user shared file directly through the link, you can create sharing Link for a DriveItem
by consenting to the necessary permissions-Files.ReadWrite.All
, Sites.ReadWrite.All
Reference document: https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http
Hope this helps.
If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".