I've been using this custom service for ahwile:
'event' => array(
'retrieve' => array(
'help' => 'Retrieves a single event',
'file' => array('file' => 'inc', 'module' => 'drupalconnect', 'name' => 'drupalconnect'),
'callback' => '_event_retrieve',
'access callback' => '_whatson_resource_access',
'access arguments' => array('view'),
'access arguments append' => TRUE,
'args' => array(
array(
'name' => 'event nid',
'type' => 'int',
'description' => 'The event node id',
'source' => array('path' => '0'),
'optional' => FALSE,
),
),
),
),
Then in the callback I just do my thing and retrieve all the content I need based on the nid: function _event_retrieve($nid) {...}
When I started I wasn't sure what I was doing, but I found accessing the service through www.example.com/js-api/event/117.json got my information.
That's great, but now I need more arguments.
I added another argument like:
array(
'name' => 'image width',
'type' => 'int',
'description' => 'pass image width',
'source' => array('path' => '0'),
'optional' => FALSE,
),
function _event_retrieve($nid,$width){...}
But how do I send that argument through the url in its current state?