0

Is there a way to get the embed URL through onedrive's API.

An embed URL is a publicly accessible URL that does not require a login since it contains an authkey.

I did manage to get the cid and resid, however, I can't figure out how to get authkey. Is there any way to get it? I'm currently on onedrive's python SDK.

1

1 Answer 1

2

You should be able to use the createLink API to request an embed link.

POST /me/drive/items/{item-id}/createLink
Content-Type: application/json

{
  "type": "embed"
}

See this documentation for full details.

The SDK should also have createLink exposed so the above should map relatively easily into your use-case.

3
  • 1
    I did manage to get an object in response to the https://login.live.com/oauth20_token.srf. This object has a refresh_token and an auth_token. However, if I call https://graph.microsoft.com/v1.0/me alongwith 'Authorization': "Bearer " + access_token_for_graph,, I get "error": { "code": "InvalidAuthenticationToken", "message": "CompactToken parsing failed with error code: 8004920A", "innerError": { "request-id": "somerequestid", "date": "2019-01-23T06:37:14" } } }
    – LEE
    Jan 23, 2019 at 6:37
  • Also, since I am already using python sdk for one drive where I have managed to successfully upload a file using client.item(drive='me', id='root').children['document_14_01_2019_3_36_PM.xlsx'].upload( './' + 'document_14_01_2019_3_36_PM.xlsx'). Can't i use a similar approach to createlinitem?
    – LEE
    Jan 23, 2019 at 6:41
  • @Abhilash, were you able to find a solution? Sep 14, 2021 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.