How do I create a sharing link with the Graph API which works for users in other tenants?
When I create a sharing link in the MS Teams app, I have the option to create a link for users with existing access:
(apologies for the mixed languages; Teams sometimes incorrectly overrides its own settings with the system language)
This creates a link in the following form:
https://gfinet.sharepoint.com/:x:/r/sites/GFIMS-TeamsTestteam/Shared%20Documents/General/ShareTest.xlsx?d=w757509dff3ff41e7b78007afb861736e&csf=1&web=1&e=oRcd5Z
The link can be accessed by users in any tenant who have access, e.g. via groups.
How can I create links like this from the Graph API? The only documented options for scope are "anonymous", "organisation", or "users". Links created with organisation scope prevent users from other tenants cannot use the link even if they have permission to access the file.
If this is not possible with the Graph API is there another way to build the URL?