[Drupal] What are Web Services and why use web services in Drupal?

| | 3 min read

In order to communicate and interact with other web applications we need to use standard communication protocol called web services. The web applications such as Facebook, flip kart, twitter etc can communicate to and fro with Drupal sites.Web services will also allow our Drupal site to pass along content and data to external web applications existing on remote servers.

When we talk about web services to interact with our Drupal sites. The particular protocol should be able to communicate with any and different environments. For example, we might want to make our Drupal website call and interact with our Flickr photo gallery, or we may want to take all of our Drupal home page content and push it over to our Facebook account. We can do both of these actions using the web service protocols.

The base foundation for web services is a protocol or code called XML. For our Drupal site, to interact with a website or application on another server, we need to use XML, which is a language commonly understood between different applications. Our site and server understands XML as does the application we want to communicate with. We can do this over the standard HTTP protocol for website communication.

Why use web services in Drupal?

With web services, Drupal content can be shared with other web applications. Our content is no longer just our content and it is not specific to our Drupal website. It can be shared and integrated. Drupal is actually PHP based codebase and many frameworks like Joomla, word press are also php based and can also be integrated easily due common programming language to these applications.

The below are some of the web services used by the Drupal site for interaction with the client applications:

  • Mollom

    Mollom is a web service that is used to block spam bolts on Drupal sites. The mollom provides captacha options to the users logins and registeration to the sites. There are also other contributed modules like honey pot and recaptcha to avoid spam entering the drupal sites. The mollom contributed module is available at http://drupal.org/project/mollom.

  • Facebook

    Drupal can connect to Facebook and canvas pages using the module. The Drupal for Facebook module is actually a larger scale module that allows you to program applications that run on Facebook and/or on your Drupal site but provides Facebook mechanisms.

  • RSS

    Here drupal can create RSS feeds for any block or nodes using views module to set up attached feeds. So, Drupal provides a very flexible environment for allowing other external web applications access to your content feeds.


REST is one of the standard web service protocol used in the Drupal community due to its flexibility. REST allows following when we take a web service using its protocol:

  1. Use a standard method such as XML
  2. Send the message over standard protocol(HTTP)
  3. Provide or connect to specific resources where each resource (image, document, page, and node) is given a unique resource identifier (a URI)

The configuration on REST to integrate to Drupal site can be referenced at (https://api.drupal.org/api/drupal/core!modules!system!core.api.php/group/third_party/8)