I'm having trouble retrieving the relative path of a file using CAML:
http://[siteURL]/_api/web/lists/GetByTitle('test')/GetItems(query=@v1)?@v1={"ViewXml":"<View><ViewFields><FieldRef%20Name='FileRef'/></ViewFields><Query></Query></View>"}
It returns following results which don't contain the FileRef field I'm querying for:
<entry m:etag=""2"">
<id>Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)</id>
<category term="SP.Data.Asset_x005f_RightsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link rel="edit" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/FirstUniqueAncestorSecurableObject"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/RoleAssignments"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/AttachmentFiles"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/ContentType"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/FieldValuesAsHtml"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/FieldValuesAsText"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/FieldValuesForEdit"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/File"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/Folder"/>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'18bbc395-68ef-4a43-af94-54dfa73fffce')/Items(2)/ParentList"/>
<title/>
<updated>2015-11-03T14:37:22Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
<d:Id m:type="Edm.Int32">2</d:Id>
<d:ID m:type="Edm.Int32">2</d:ID>
<d:Modified m:type="Edm.DateTime">2015-10-01T12:40:33</d:Modified>
<d:CheckoutUserId m:null="true"/>
<d:EditorId m:type="Edm.Int32">1</d:EditorId>
</m:properties>
</content>
This is strange because the same query works fine when I test it in CAML Designer 2013. It also works when I query for other fields, for example document title, ID, etc. Any idea what could be the problem?