0

I am using the REST API for OneDrive. I have a name of a file in the users storage. I want to obtain the properties for this file. According the documentation file's properties can be retrieved if you have the file ID.(http://msdn.microsoft.com/en-us/library/dn659731.aspx) So I need the file ID and the only way I see to obtain it is to search the whole storage which is really unnecessary. Is there a way to find properties of a file(with a known name) with a single request to the service?

1
  • There isn't - you either need to search, as Brad answered below, or use multiple calls to the service to walk down the path hierarchy to the file.
    – Ryan Gregg
    Jul 11, 2014 at 5:00

1 Answer 1

1

Ideally the API would support access by path which would do what you require (assuming you have the full path and not just the name). Unfortunately, to my knowledge that isn't supported.

There is a heavy handed approach that may work for you though - you can use the search capabilities of the API to find files with the name you specify:

GET /[userid]/skydrive/search?q=MyVideo.mp4

The documentation is available at the link below:

http://msdn.microsoft.com/en-us/library/dn631847.aspx

1
  • can we get public share link once I will upload image in one drive. So other people can directly access that image?
    – kb920
    Jun 17, 2015 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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