3

Whether it is sharing a file/folder from OneDrive or from a SharePoint site, I noticed that sharing the same file twice, with no changes to the path, file name or scope of sharing, two different URL's are generated. Preferably, I want a "permalink" for the same file, assuming no change to its path or its sharing scope, so that I can easily share it now and forever, with whomever.

For instance, I have a SharePoint file that I want to share externally, in read-only fashion. However, I noticed that creating the link a second time via Share, most of the URL is the same as the first time but the end differs...

https://virgilholdings.sharepoint.com/:w:/s/IT/ZJincz11Hr0f-wGwzA7cBH9G4MVwPdtYwQHpfbtNQPw?e=vfRdjQ

https://virgilholdings.sharepoint.com/:w:/s/IT/ZJincz11Hr0f-wGwzA7cBH9G4MVwPdtYwQHpfbtNQPw?e=NkxNPy

Note: I changed the URL's to invalidate them. These are just examples.

I tried removing the unique portion (e=xxx) and the link still worked, seemingly. It would be convenient to use the file's Share functionality whenever I want to obtain the share link (for the same sharing scope, e.g. externally, read-only) but must I heed the part that changes every time, i.e. e=xxx? What is its purpose? I can't find a reference to it online.

1
  • In regard to ?e= query string it would be good to know what it represents as I cannot access a sharedURL without it. Currently, I am creating a createlink to a specific driveId and driveItem, it creates it but when I try and read it in using another API request, like the docs required. The sharing link then needs encoded. For example: const url = https://graph.microsoft.com/v1.0/shares/u!${encodedString}/driveItem; is my graph query to read my file into memory. And to allow my app to construct a full web url with a file in the query parameters I create a link via: const createLink = `https:/
    – JasonC
    Jan 18 '21 at 15:52
1

The ?e=abcdfgh part can be removed.

https://cresyl.eu/en/office-365/understanding-how-share-links-are-built/

I think it is used for tracing the visitors of the SharePoint site or something.

0

This is called Query String. It is generated automatically based on each shared link.

The query string parameters dictate the content to show on the page, and frequently include information opaque or irrelevant to users. That’s why if you remove this part from the URL, the link will still be in function.

I’m not able to tell what “e=xxx” stands for, but here’s another example:

If we share a document with specific people with an email address, the link will be formed as “https://siteURL/:o:/g/parameters/xxxxx?email=xxxx&e=ak4re9”. The site will prompt “Sign in to email address and we'll give you access immediately” when I try to access this link.

If I remove the query string and enter “https://siteURL/:o:/g/parameters/xxxxx”, the site will prompt “To open this secure link, we'll need you to enter the email that this item was shared to.” It will not skip the step of typing the email address of the user.

1
  • Thanks but I am familiar with query strings, I really need to know the purpose of the e=xxx key/value when sharing a SharePoint link so that I know whether I can safely leave it off and get what I am after. Sep 20 '19 at 20:21
0

I would recommend keeping the d= and e= query strings. I found that if both were removed, the link would continue to point to the correct file until that file was moved, then I'd get a 404 error. Keep them in there, and no matter where you move your file, the link will remain intact.

Source: https://oneminuteofficemagic.com/2020/03/23/deciphering-the-sharepoint-online-onedrive-sharing-links/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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