How to Create "File Request" Link in OneDrive for Business via (MS Graph or other) API?

Ching Lung 0 Reputation points
2023-10-08T06:51:05.2566667+00:00

Hi,

Is there a way to generate a "file request" link of a folder in OneDrive for Business via MS Graph (or other) API?

The idea is to generate a "file request" link programmatically and send to the users and use the default "file request" UI for the users to upload their files without requiring user to have a Microsoft account to login.

I saw "create sharing link" document but there's no option to create a link for "upload only".

Thanks!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,854 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,275 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sourabh Gupta 800 Reputation points Microsoft Vendor
    2023-12-10T11:33:03.8366667+00:00

    Hi Ching Lung,

    Thanks for reaching out.

    Unfortunately, you cannot upload file using share endpoint (https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http)

    However, for your use case you can either try to create and app with application-level access and provide that to users to upload the files to that particular folder using the following graph API call mentioned in the link below https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http

    or would you consider filing a feature request on the M365 developer platform so this can be looked into?

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.