I am putting the question in two lines
Does OneDrive supports direct download URLs for files? Are URLs returned by OneDrive are same for mobile and web ? Does OneDrive returns file versions via rest API calls ?
Read below for more details.
I am building a standalone app which uses various OneDrive REST apis for different operations, e.g. upload/download/update/browse a document/folder. I have following needs which I am not able to accomplish based on readings from OneDrive rest api support page https://msdn.microsoft.com/en-us/library/office/dn659752.aspx.
- Direct Download URLs: I want to give user of my app a facility to directly downloading a file. I know currently 'link' property of file object gives a direct view URL which takes user to OneDrive account and from there user can download the file by clicking download button. I need a link for direct download of the file (such link when typed in a browser which has authenticated OneDrive session should directly prompt the download box.)
- Are direct view/download link different for browser and mobile cients?
- Versions: How do I get version numbers for files programmatically. I do not see version info in JSON objects returned via REST calls. [I have read in one of the post that versions are not supported ]
https://msdn.microsoft.com/EN-US/library/dn631834.aspx?f=255&MSPPError=-2147217396 This link shows a JSON representation of a file object.
See this link to download from URL Getting BLOB data from XHR request
hope you are trying to access some file from your download folder!!
If you, you can use url like this-
This worked for me.