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

These keys can be used when implementing hook_service

(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.
(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.
Which file defines the '#callback' function? If, 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.
Does this method require a key? Default: TRUE
Does this method require a session id? Default: TRUE
The arguments of the callback function. For each argument, you can define the following keys:
Argument name
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'.
Help text.
Is this argument required? Default: FALSE
Include this argument when computing the hash? Default: FALSE
Label used with this argument's form element on the services admin browse form of this method. Default: '#name'.
Return value data type. Same possibilities as with argument type.
Method help text.

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


gdoteof’s picture

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