I would like to use this https://docs.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http#creating-embeddable-links and display webHtml in my website. I'm trying create this link for sharepoint (SP Online) file. Unfortunately when I made a request I've got an error that this type of link is not existing. Does anyone can confirm that or know how to modify settings to make it work?
-
Not saying it's absolutely impossible, but looks like that scenario isn't supported. From the documentation linked in the original post: "Note: Embed links are only supported for OneDrive personal." So my guess is that it just isn't going to work when trying to pull content from SharePoint Online. Had the documentation said it was supported in OneDrive for Business, that would be a different story.Todd– Todd2021-10-07 21:16:29 +00:00Commented Oct 7, 2021 at 21:16
Add a comment
|
1 Answer
Try enabling anonymous external sharing within your SharePoint Online tenant. (this may be risky since your users need to be trained as to its security implications.)
Then create a link using the SharePoint UI - by right clicking the item (or left clicking the ellipses) and selecting ‘copy link’
- ensure that the proper scope ‘Anyone with the link’ or ‘Anonymous’ is selected (editable via the drop down directly beneath the link)
- Then append the following query string to the end of the generated URL from step 2: &env=Embedded
-
This solution didn't work for me, still cannot see a file in iframeIwoo– Iwoo2021-10-08 08:48:12 +00:00Commented Oct 8, 2021 at 8:48
-
Then you may be out of luck as per @ToddA.k.A. Fritz– A.k.A. Fritz2021-10-08 12:14:08 +00:00Commented Oct 8, 2021 at 12:14