Services Tutorials and Examples

The following tutorials and examples will help get started with Services.

As time has gone on, many of these samples have fallen severely out of date. I have been attempting to re-classify them to the versions that are appropriate. If you encounter a sample that is version-specific, please edit and move it. If you find that a sample needs tweaks for a version, add that information into the comments and we'll roll it in or make new samples elsewhere.

If you are getting an Access Denied error when running these samples that is probably because finer access permissions were recently added in later versions.

For instance in the Flash 8 example, it loads a node. Using the latest Services (as at 29/5/08) you'll have to also check that 'load raw node data' under 'node_service module' is checked in your Access control for the example to work. Another thing to remember is a crossdomain.xml file in the root directory if your app is communicating with a remote site.

Examples of xml-rpc user.update drupal 7 services

Other possible things to check:

  1. A lot of these examples use the method node.load(), this has changed to node.get() in 1.x
  2. The Permissions have moved to each services own module section. For example instead of 'load raw node data' look under "Node_service module" and the permissions : 'load any node data' & 'load own node data'.
  3. Betweeen Services 6.1 and 6.2, Key Authentication was moved into a submodule which has to be explicitly enabled and configured.

.NET API to integrate with Drupal 7 via XML-RPC and Services 3 module

The project I'm introducing here wraps around Charles Cook's excellent XML-RPC.Net library and exposes a number of convenience methods to

Example of Java XML-RPC client with Drupal7 and Services 3.x

Please find below a small example in Java and XML-RPC using Drupal7 and Services 3.X.

Example xml-rpc post for user.update

Example: Authenticate user and create node using Services 3.0 XML-RPC and Python

After you have exposed the node and user resources you can first log in a user and perform an action with the session cookie returned. To

Example: User login with API key using C#

The following example will explain how to connect to your Drupal site using the Services module with the usage of an API key and login a

Parameter formats in the browser

The browser provides three formats for use with the complex parameter types struct and array. These formats are JSON, serialized PHP and

Services 3.0 Python example using XML-RPC and OAuth2

This code connects using two-legged OAuth to a drupal host running services-3.x, OAuth and an XMLRPC endpoint. This example uses two

Services 6.x-2.0 PHP example using XML-RPC for PHP

This example is to show you a basic method call (so not including e.g. API keys) and how to construct the URL. On your XMLRPC server website

Services 6.x-2.0 PHP xmlrpc example with api key

Here's some working logic that I cobbled together from various partial examples online and the deploy module. It's rough, but works. The key

Services 7.x-3.3, REST Server using 2-Legged OAuth in PHP, OAuth 7.x-3.x-dev

The Drupal REST services is an user-created module for Drupal 7 and 6.

Version 5

Services samples and tutorials for Version 5.x. Please put these samples here.

Version 6.0 / 6.1

Code samples and tutorials for the 6.0 and 6.1 branches.

Version 6.2

Code samples and tutorials for Services 6.2. Please put samples for this version here.

configure page size for taxonomy using services

The services module limits the amount of taxonomy vocabularies and taxonomy terms it shows to 20 by default.

Guide maintainers

MattKelly's picture