2

I'm looking to render a large list of links to documents that reside in SharePoint and would like to do so by using the GUID attribute. I'm trying to avoid additional queries to the SharePoint REST API and cannot use CSOM or JSOM. Is it possible to construct links to sharepoint documents via the GUID? If so, how are they constructed?

1
  • what do you mean by External links? Does it mean that these links to be be available anonymously by anyone with these links? or it simply means "Direct link to the document". Also, do you only need links to Word, Excel, PowerPoint? Or there are all sorts of document types? Apr 13, 2020 at 22:36

1 Answer 1

1

If GUID is all you have and you want to avoid extra requests via REST, then the only way to construct the links is this.

You need to construct a URL using the following parts:

  • https://TENANT.sharepoint.com/
  • :w:/r/sites/SITE_COLLECTION/
  • _layouts/15/Doc.aspx?sourcedoc={DOCUMENT_GUID}

Sample link:

https://contoso.sharepoint.com/:w:/r/sites/SITE_COLLECTION/_layouts/15/Doc.aspx?sourcedoc={BBF53FD3-4E3B-428D-9AC5-AE98E99E25CE}

Limitations

  • This method will work only with Word, Excel and PowerPoint. It might work with PDF, but I didn't test it yet.
  • Other types of documents won't open with this link.
  • It will open the document in the browser.
  • Users must already have access to these documents.
1

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.