I'm doing this tutorial to get familiar with the concepts of the Services module. In that tutorial, you implement a custom service for the Services module. Therefore it uses hook_services_services. But there are other tutorials (e.g. An introduction to Drupal 7 RESTful Services) that use hook_services_resources for the same thing. So what is the difference?


The first article is incorrect, there is no hook_services_services() (at least not according to any documentation for the services module, nor in my experience).

The correct hook to use is hook_services_resources(). See the docs/services.services.api.php file included with the module for full details.

  • What about this: api.drupalhelp.net/api/services/… – Javiator Feb 24 '14 at 13:58
  • Also wrong - there is no hook_services_services() or hook_service() in the Services module. That file doesn't even exist any more, those docs are woefully out of date – Clive Feb 24 '14 at 14:06
  • Could you please point me to a working example with detailed instructions? Whatever I try it doesn't work. I just can't find a working example. – Javiator Feb 24 '14 at 14:17
  • You'll find a working example in the module itself, in the docs/services.services.api.php file. I can confirm that example works perfectly, I've used it as a base for dozens of projects over the years – Clive Feb 24 '14 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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