What will be the URL for a REST GET service with multiple arguments

Events happening in the community are now at Drupal community events on www.drupal.org.
adasgt's picture

Hello,

If I have a hook_service_resource() implementation as follows and my url of the end point is

"localhost/services/mylist"; what should be my full url with the two arguments?

function rest_managed_items_services_resources() {
return array(
'myList' => array(
'retrieve' => array( 'help' => 'Retrieves list of managed items',
'callback' => 'rest_managed_items_list_retrieve',
'access callback' => 'rest_managed_items_list_access',
'access arguments' => array('view'),
'access arguments append' => TRUE,
'args' => array( array( 'name' => 'id',
'type' => 'string',
'description' => 'An id String',
'source' => array('param' => 'id'),
'optional' => FALSE,
),
array( 'name' => 'name',
'type' => 'string',
'description' => 'A name String',
'source' => array('param' => 'name'),
'optional' => TRUE,
),
),
),
),
);
}

Thanks for any help.

Comments

url

stonevo's picture

I think you url should be localhost/services/mylist?id=xzy&name=xyz

Drupal - The modern Lego game

url

wildermuthn's picture

/endpoint/resource/index?id=xyz&name=xyz

The 'index' part is what made it work for me, D6, Services 6.3

Services

Group organizers

Group categories

Group notifications

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