index

Events happening in the community are now at Drupal community events on www.drupal.org.
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&parameters[type]=playlist&page=1

Comments

Hello, have a look at

Posted by bst2002 on November 20, 2012 at 8:30am

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!

Posted by DrMiaow on November 20, 2012 at 11:05pm

/**
* 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&parameters[nid]=7&parameters[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?
*/

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week

AltStyle によって変換されたページ (->オリジナル) /