I'm able to call GetItems through REST by using an example by Erik C. Jordan.
Now I'm trying to combine this with a simple OData $filter parameter.
I have a REST query like this (jQuery on SharePoint Online):
var query = {
ViewXml: "<View><Query><Where><Contains><FieldRef Name='Title'/>\
<Value Type='Text'>hello</Value></Contains></Where></Query></View>"
};
var params = $.param({
$top: 5,
$filter: "substringof('sdf',Title)"
});
params = params + '&@q=' + JSON.stringify(query);
$.ajax({
type: "POST",
dataType: "JSON",
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
url: "/_api/Web/Lists/GetByTitle('Test')/GetItems(query=@q)?" + params
});
This query will fail with the message Field or property "Title" does not exist..
If I remove the parameter $filter it works fine. Other parameters such as $select and $top works fine.
I have tried to add <ViewFields><FieldRef Name='Title'/></ViewFields> to my View Xml without luck.
Any suggestions?