Get external URL with Picker for a file in OneDrive Business - onedrive

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?

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

Related

How to access BigCommerce internalapi?

I am trying to download (backup) images that customers upload for products that take custom logos (these are typically JPG, PNG, PDF, etc.) These customer files are downloadable by clicking on a hyperlink in the BigCommerce admin page for the order in question. The link is not a link to the image path but instead, a link to a service that sends the file to the browser. In other words, you have to be authenticated into the admin site to download the file. The URL looks like this:
https://mystore.com/internalapi/v1/orders/383945/products/251438/attributes/561518/download
https://mystore.com/internalapi/v1/orders/{order id}/products/{lineItem id}/attributes/{option id}/download
These are easily constructed in the API itself for a given order. If I use the link in a browser tab while I'm logged into the admin site, the file downloads.
But what I am trying to write an app to automatically download all the files (there are thousands). When I try to use this URL in an app, I get a authentication error. I tried at first using my regular API credentials but then used the credentials to log into the admin site. Both give me an authentication error.
I could not find anything documented on this so-called "internalapi." Anyone ever try to use this "internal" API that is used by the admin site?
I believe authentication is cookie based for that internal API, but there could be problems with using our non-publicly documented internal APIs in production, i.e. we may make future updates that would be breaking changes.
Images attached to orders through a file upload option also get copied to WebDAV, in the dav/product_images/configured_products folder. Another way to do this could be to use a WebDAV client library like easywebdav to connect and download the files.

OneDrive API Link Sharing Options

I'm currently working on an application that interacts with OneDrive. I've read RESTful API manual and the only option available is to share document.
My questions are:
Is there any way to remove or regenerate file sharing link?
Is there any way to specify user emails to give an access to them?
Is there any way to control this UI option "Recipients need to sign in with Microsoft Account"?
The sharing links that are created do not expire. If you create a sharing link for a file that already shared, a HTTP 200 code will be returned. At this time, createLink is only available but the user can remove the sharing permission from the OneDrive website. Specific user access isn't currently supported. Like the OneDrive website, any created link will not require sign-in. I hope that helps.
The only way to regenerate link to a file is to:
Copy file "foo.docx" to "(Copy) foo.docx"
Remove file "foo.docx"
Rename "(Copy) foo.docx" to "foo.docx"
Generate link for "foo.docx"
There is no way to specify emails for document access
There is no way to control this UI option "Recipients need to sign in with Microsoft Account"

Using dropbox Chooser drop-in to retrieve a non-expiring link to files

I would like to use the Chooser drop-in to select a file from dropbox and then synchronize my app with that file occasionally in the background.
https://www.dropbox.com/developers/dropins/chooser/js
A scenario would be:
List item
User selects file.
File uploads to my app.
User returns to my app a few days later after modifying the file in dropbox.
My app should synchronize and pull down that particular file (without again displaying the Chooser drop-in).
The problem is that the Chooser provides an expiring link to the file:
"direct" is an expiring link to download the contents of the file
I can use the Core API exclusively which would work, however I would have to build my own UI to browse the user's dropbox directory. Ideally, I'd prefer to not introduce the world to another file browser; Dropbox has a file browser - and people are familiar with it. Is this possible?
Thanks,
You can just get a preview link and convert it. See https://www.dropbox.com/developers/blog/53/programmatically-download-content-from-share-links.

Accessing Other user's OneDrive public folder using OneDrive link

I want to integrate OneDrive in my App and want to add a functionality to share data with other user using the public folder's on Onedrive. I can see that OneDrive provides the functionality to create a Link to folder and files. But I cant get the reference on how to create it programmatically. Also once the link to folder or file is created ,is there a way to access it using APIs ?
Please some one advice.
regards
The following is probably what you're looking for:
http://msdn.microsoft.com/en-us/library/dn659732.aspx#get_links_to_files_and_folders

Dropbox Application; Is it possible to check when a folder or a file is created or modified?

Is it possible to check when a folder or a file is created or modified in my Dropbox Application's folder?
All right, I found the answer.. Developers who want to get information of changes user did in application can use dropbox Delta API or REST API Delta URL..
dropbox.com/developers/reference/api#delta
"https://api.dropbox.com/1/delta" URL in REST API returns last changes as a Json Object.