Alex
Alex

Reputation: 1593

Get external URL with Picker for a file in OneDrive Business

I want to get a permanent external link to a file in OneDrive Business using JavaScript Picker API. The link should not expire and should allow to download the file without logging in.

I have enabled external file sharing in my OneDrive Business account. In the UI, I can get a link like https://[my_host].sharepoint.com/personal/apps_tmp_onmicrosoft_com/_layouts/15/guestaccess.aspx?docid=...&authkey=.... This link is what I need.

But when I pick the same file in the picker, I get a link https://[my_host].sharepoint.com/personal/apps_tmp_onmicrosoft_com/_layouts/15/guestaccess.aspx?guestaccesstoken=...&docid=2_...&rev=1. This link requires to log in.

There is no such problem with a personal OneDrive. Is it possible to get a link to the file in OneDrive Business with authkey using the Picker?

Upvotes: 0

Views: 451

Answers (1)

Alex
Alex

Reputation: 1593

Solved the issue by adding createLinkParameters: { type: 'view', scope: 'anonymous' }.

Upvotes: 0

Related Questions