Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Decode SharePoint Online Sharing links #1870

Closed
semopz opened this issue Jul 16, 2019 · 0 comments
Closed

Decode SharePoint Online Sharing links #1870

semopz opened this issue Jul 16, 2019 · 0 comments

Comments

@semopz
Copy link

semopz commented Jul 16, 2019

Category

[ ] Bug
[x] Enhancement

Environment

[x] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013

If SharePoint on-premises, what's exact CU version:

Expected or Desired Behavior

This is more of a question than a suggestion. I'm looking for a CSOM or a REST API that would allows me to decode any kind of a SharePoint sharing link. For example, if you got to a modern UI library to get the link of document, you may be presented with something like this:
https://contoso.sharepoint.com/:i:/r/sites/someweb/SiteAssets/cats.jpg?csf=1&e=L9eqe2
This may not look too bad but sharing/anon links are a lot more cryptic.

As a developer, I should be able to decode any links generated by SharePoint (and therefore provided to my app/service/function via a user) in order to get the file's actual path and content.

Observed Behavior

If I supply a link that I've obtained from the SP Online Modern UI interface and feed it as a URL param to Get-PnPFile, I will not get a valid SPFile object. I'm using a PowerShell cmdlet as an example here but other PnP libraries or _api calls will result in a failure.

Are there any APIs that would allow me to decode a valid SharePoint links that users may supply to my solution?

Steps to Reproduce

  1. Get a link to a file from a SharePoint Online Modern UI library
  2. Try to obtain content or field information using SharePoint APIs with the link obtained in step 1
@semopz semopz closed this as completed Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant