Posted by DrMiaow on November 20, 2012 at 1:41am
Took me hours to locate this information.
If you want to use the 'index' operation in services, it takes only three parameters
page (the page number)
fields (the fields to include).
parameters (the actual parameters) - these are passed directly into the query, so these need to be node record field names.
eg:
/api/test/rest/node?fields=nid,title¶meters[type]=playlist&page=1
Comments
Hello, have a look at
Hello,
have a look at services/resources/, in your case node_resource.inc and search for "function _node_resource_index" read description above, you can find other usefull doc in the resource files ;-)
Cheers
Thanks!
/**
* Return an array of optionally paged nids baed on a set of criteria.
*
* An example request might look like
*
* http://domain/endpoint/node?fields=nid,vid¶meters[nid]=7¶meters[uid]=1
*
* This would return an array of objects with only nid and vid defined, where
* nid = 7 and uid = 1.
*
* @param $page
* Page number of results to return (in pages of 20).
* @param $fields
* The fields you want returned.
* @param $parameters
* An array containing fields and values used to build a sql WHERE clause
* indicating items to retrieve.
* @param $page_size
* Integer number of items to be returned.
* @return
* An array of node objects.
*
* @todo
* Evaluate the functionality here in general. Particularly around
* - Do we need fields at all? Should this just return full nodes?
* - Is there an easier syntax we can define which can make the urls
* for index requests more straightforward?
*/