I am trying to create a sharedURL via a picker in my app that constucts a web url with a query par linked to a sharepoint file, which reads into the app on load. For some reason if I grab the manual sharedURL from sharepoint it works, as I endode it and point to:

const url = https://graph.microsoft.com/v1.0/shares/u!${encodedString}/driveItem;

With auth and grabbing the @microsoft.graph.downloadUrl I can easily read into memory and into my app. so all good!

However I cannnot get the createLink from graph api to work as it does not include the ?e= query par, like a manual share option does. It would be good to know what it represents as I cannot access the content without it.

const createLink = https://graph.microsoft.com/v1.0/drives/${driveId}/items/${itemId}/createLink;

I get back a successful 200 or 201 on POST the create the link and has the same weburl but without ?e= so am thinking that is the issue. but when I read it in, it says Requested sharing link could not be found.

Could someone please advise pls?

  • btw this is connecting to organisations, so could be a permissions issue but ive added Files.ReadWrite, Files.ReadWrite.All, Sites.ReadWrite.All to Azure and my auth login request
    – JasonC
    Commented Jan 18, 2021 at 17:13

2 Answers 2


The ?e= query par doesn't affect anything. If you grab the manual sharedURL from sharepoint and remove the ?e= query par from the link, it would still work for you.

For your issue, after you creating the share link, please try to access this item in the browser with the createLink.

Then use graph api to access this createLink, check if it works for you.


Yes, it's the permerssion issues. When you select file from your onedrive, you already have access to the file. So you could read the file with the createlink. However, when creating the kink on orgainsation level, your permission is not granted. So you can not read the file. After you visiting the link via browser, your permission is automatically granted. Then you can read the file with the createlink. Also you could grant permission on the link through the graph api:https://docs.microsoft.com/en-us/graph/api/permission-grant?view=graph-rest-1.0&tabs=http

  • Thanks for replying, ive been testing it today. If I select a file from my personal drive the createlink works and I can read the file, on orgainsation level I can create the link but cannot read the file. Do I need to look at permissions or roles when creating the link to determine who can access it ? both links work when visting via the broswer
    – JasonC
    Commented Jan 19, 2021 at 12:18
  • something similar to this, docs.microsoft.com/en-us/graph/api/…. Am I on the right path?
    – JasonC
    Commented Jan 19, 2021 at 12:20
  • Yes, you are right. That's the permisson issues. You could check my updated answers. Commented Jan 20, 2021 at 2:31
  • Thanks for the updated answer. I am getting to understand the permissions abit better now but still cannot get the create a link to work on org level. docs.microsoft.com/en-us/graph/api/… does not work on an org level only personal or via a manual shared link. This is getting the weburl from the createllink post (encoding it ) the request that endpoint to grant permissions, on an org level I get sharing ID is not found, even tho my encoding is workly correctly on my personal and any manual sharing links from SharePoin. ill post code
    – JasonC
    Commented Jan 21, 2021 at 17:30

Update - createLink endpoints return a webURL to give you access to the file (if you have permissons of course)

I can decode those webURls to get access to the sharing endpoint that allows me to download the file.

I will close this now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.