3

I'm using the /_vti_bin/listdata.svc endpoint in the SharePoint 2010 REST API to update file metadata. At the moment I'm referencing the file by ID, but I'd like to use the file's path or filename instead.

Is there a method I can use to reference a file directly by it's path, similar to getFileByServerRelativeURL() from SharePoint 2013 onwards?

2
  • are you using javascript or C#?
    – Mike
    Mar 13, 2017 at 1:20
  • Neither - I'm making direct HTTP requests to the REST API. Mar 13, 2017 at 7:12

1 Answer 1

2

You can use $filter query string and a property called "Name" like

/_vti_bin/Listdata.svc/myList()?$filter=Name eq 'Task3'

to get only the item which has its name as 'Task3'

2
  • That's not to grab the file, but a list item.
    – Mike
    Mar 13, 2017 at 14:56
  • I tried this and it does also work for libraries, where Name refers to the filename. Mar 14, 2017 at 0:39

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.