Last updated July 18, 2013. Created on April 19, 2009.
Edited by jessehs, kylebrowning, PieterDC. Log in to edit this page.

These keys can be used when implementing hook_service

#method
(required) Public method name. If it contains a dot, the part before the dot is assumed to be the namespace, the other part: function name.
#callback
(required) Function name of the method in your code.
#access callback
Which function does some access control? If not defined, the user_access function will be used.
#access arguments
Arguments for the '#access callback' function. If not defined access arguments will be ignored.
#file
Which file defines the '#callback' function? If node_service.inc, then write array('file' => 'inc', 'module' => 'node_service'). This is not required if you define your methods in the .module file. Array keys are 'file', 'module', and 'file name', following the module_load_include API.
#key
Does this method require a key? Default: TRUE
#auth
Does this method require a session id? Default: TRUE
#args
The arguments of the callback function. For each argument, you can define the following keys:
#name
Argument name
#type
Argument data type. Choose one of these: boolean, double, int, string, array, struct, date or base64, see xmlrpc_value_calculate_type(). Ps: you can use 'big' to get a textarea in services admin browser but it really is data type 'string'.
#description
Help text.
#optional
Is this argument required? Default: FALSE
#signed
Include this argument when computing the hash? Default: FALSE
#title
Label used with this argument's form element on the services admin browse form of this method. Default: '#name'.
#return
Return value data type. Same possibilities as with argument type.
#help
Method help text.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

gdoteof’s picture

'access services' does not appear to be a permission that comes with services, only 'administer services'