I want to pass some url-GET parameters through services, I read somewhere that I shoud pass an array, but I can not find any examples. Can anybody please tell me how I have to pass parameters?

I have an endpoint http://www.mytestdomain.com/mytestendpoint/mynodes
where mynodes is the alias for the noderesource. I am able to get all or one node, but I don't know how to get all nodes from contenttype 'mytasks' .

Comments

vantuykom’s picture

anybody? please?

garethsprice’s picture

On D7, to return all nodes of type "event" via the Node services resource: http://localhost/api/node?parameters[type]=event

mugginsoft.net’s picture

For the argument list that can be used for the node resource index operation see
services/resources/node_resource.inc function _node_resource_index

The function header for _node_resource_index says:

/**
* Return an array of optionally paged nids based on a set of criteria.
*
* An example request might look like
*
* http://domain/endpoint/node?fields=nid,vid&parameters[nid]=7&parameters[...
*
* 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.
* An array of node objects.
*/