Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

enter image description here

D7 / Services 3.2

retrieve / create / update / delete are very straightforward, make senses to me that matching 'CRUD', I don't understand what 'index' here does?

Thanks.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

'Index' in services module will list out an entity(node, users, taxonomy..) in descending Order of its created time, vid, name etc based on the arguments that are passed. The common arguments for the Index are

  1. Page - Page number of results to return (in pages of 20).
  2. Fields - The fields you want returned.
  3. Parameters - An array containing fields and values used to build a sql WHERE clause indicating items to retrieve. (array)
  4. Page size - number of items to be returned. (Integer)

    In case of retrieve, it returns the complete entity object of the passed 'entity_id'

UPDATED:

Sample URLS for Index is

  • http://domain/endpoint/node?fields=nid,vid&parameters[nid]=7&parameters[uid]=1&page=2
  • http://domain/endpoint/taxonomy_term?fields=tid,name&parameters[tid]=7&parameters[vid]=1
  • http://domain/endpoint/user?fields=uid,name,mail&parameters[uid]=1

For documentation you can see the link http://drupal.org/node/109782

share|improve this answer
    
How do I construct the 'index' argument in uri? e.g page argument. Is it something like: http://<domain>/<endpoint>/<resource>/page/3 ? Is there any documentation on the web? (i am having hard time searching for docs) –  gilzero Nov 15 '12 at 5:58
    
@ gilzero I have updated the answer. –  Dinesh Kumar Nov 15 '12 at 6:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.