question

PabloGlomby-5415 avatar image
0 Votes"
PabloGlomby-5415 asked saldana-msft edited

Get sharing link using GET /shares/{shareIdOrEncodedSharingUrl} does not work across Tenants

Hi!
I need to just validate if a link is a legitimate sharing link.
To perform this, I just call the GET /shares/{shareIdOrEncodedSharingUrl} Graph endpoint.
In {shareIdOrEncodedSharingUrl} I encode the link I want to analyze to base64.
If that link belongs to the same tenant than the user doing the query, it works... but if the sharing link belongs to another tenant, it does not work (error 403).

I am using Graph Explorer and I tried specifying redeemSharingLink or redeemSharingLinkIfNecessary in the Prefer header but it's the same.

In the documentation it does not mention that the sharing link needs to belong to the same tenant.

Thanks

sharepoint-devmicrosoft-graph-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered AllenXu-MSFT commented

Hi @PabloGlomby-5415,

Per my test, I got the same result as yours on my end. Currently, the GET /shares/{shareIdOrEncodedSharingUrl} endpoint can only get shared DriveItems in the same tenant.

As a workaround, you could use https://graph.microsoft.com/v1.0/me/drive/sharedwithme?allowexternal=true to list the items shared with me, it would conatain external items.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks but this is not what I am searching. I want to at least know if a given URL is a valid sharing link or not (even if I cannot get the file name).
If I get a URL belonging to AnyoneCanView, sharedwithme will not return it.

Thanks

0 Votes 0 ·

If so, you have to in the same tenant. It cannot access shared items in other tenants

0 Votes 0 ·

@PabloGlomby-5415,

Did you refer to michael's comment above? Is there any progress?

0 Votes 0 ·