OneDrive API - createLink with type "embed" returns dead urls

New Contributor

Hello. I've just started using OneDrive Rest API (I'm using if that's important). What I'm trying to accomplish is to get embed url for some pictures from OneDrive.


I get an error while using createLink method with type = "embed". I receive an url in format "" that leads to non-working page:




If I try to get link from onedrive website interface (using "Embed" option) it works fine but it's in different format (


Am I missing something? Is there way to get working embed urls via OneDrive API?


PS I've found that some people also receiving the same issue -

What I've also found that in 2016 ember urls were unavailable in API ( Maybe nothing changed since then.

1 Reply

Figured the solution:


I've looked up how exactly onedrive is getting embed url when you use "Embed" on website. Turned out it uses other function than createLink - it uses /thumbnails.

And you can also use this function as it is a part of Rest API - as result you'll get links in format that seems to last forever. If you remove all the parameters from url (?width=768&height=1024&cropmode=none) it will lead to the original image.

PS The problem with this method - thumbnail urls are dying within 4 hours (from my experience).