How implementing Drupal’s API-First approach will make your online initiative stand out

  • By :Shefali
  • Date :11-07-2017

Did you know that by the year 2020, the number of internet connected devices will exceed 50 billion?! Technology is advancing in supersonic speed and as a consumer brand, your business strategy needs to catch up fast. Staying ahead of the game will give you the much needed edge over your competitors. The content revolution has begun. Content consumption is not just restricted to one format today - which used to be just a plain old website. It is being consumed via different devices and channels like mobile apps, wearables, IoT devices, virtual reality, smart TVs and conversational interfaces. Delivering content to these varied devices is a huge challenge that every content provider will have to take up if they don’t want to be side-lined in the near future.

Enter Mr. API

Let’s just say I want to build an app that needs to display the weather and climatic conditions of different parts of the world. The smart thing to do would be to make an API (Application Programing Interface) call to the server that gives me that information and get the required data in a format that’s readable by me. Now this format needs to be completely independent from the display device or technology. This way, I can get any information I want by just using an API and project it on multiple channels.

Look at API as a messenger that conveys to the server whatever you want to do and returns a response to you. With APIs you can access and use third-party code that can greatly reduce your work and increase efficiency. In Headless Drupal (we shall talk more about it soon), the presentation layer is separated from the Drupal backend layer. Which means that Drupal does not have to worry about how to showcase the data to the end-user anymore. Drupal can focus on what it is best at and that is content management at the backend.

The future-proof Headless Drupal CMS

In this approach, Drupal does not have to bother about how to look good to the end-user. It can concentrate on its content management and delivery regardless of the various touch points. The most beautiful part about this approach is that the front-end team and back-end team do not have to depend on each other for anything! This will also improve the performance of your application and will be well-equipped to keep up with the growing need for content delivery touch points.

A headless Drupal approach will need you to build a RESTful (Representational State Transfer) API on Drupal. Once this is done, exchange of data to and fro can be done with JSON objects. JSON is almost a universally accepted format based on Javascript. The other big tasks like validation, authorization, content management, etc. are all captured and performed by Drupal back-end. Mobile apps, front-end frameworks and third party apps can use Drupal’s RESTful API once done.

Why the API-First approach?

So now that we know that there is an increasing need to deliver and publish content across diverse touch points and channels, consumer brands must treat content like data. In order for content to be understood by every device, it needs to be structured. Structured content is organizing digital content into independent fields. With this structured architecture of content, you can Create Once Publish Everywhere (COPE). Which means that your structured content can now be consumed and understood by numerous touch points and smart devices.

Normally, companies first create their web application and then build an API that can support mobile apps and other third party integrations. This strategy creates a conflict when you want to add more touch points or integrations. In an API-first approach, you first build and API and then build your web / mobile application on top of it. This way, your online initiatives become easily scalable as adding and modifying information will be simple.

With Drupal’s API-first approach, organizations can decouple the architecture into front-end and back-end. For the presentation and theming layer, front-end frameworks like AngularJS, React, Eber, etc. can be used in order to build a compelling and effective user experience. So when you have a front-end team focusing only on the UI and UX, you are bound to get more effective output. Drupal can now act as your service layer that drives complex digital ecosystems with the help of APIs.

Drupal 8 is API-friendly out-of-the-box. With modules like Serialization module and RESTAPI module, you can easily create your own APIs that can communicate with the backend and other third-party web-services.

To briefly sum up the advantages of Drupal’s API-first approach:

  • This decoupled approach can separate the presentation layer from the service layer thus allowing a detailed and dedicated focus on each of them.
  • A very futuristic approach which will help your organization in connecting to as many new digital touch points as possible.
  • When you can interact with your customers on devices preferred by them, you are scaling up your marketing efforts.
  • Changes are always welcome with this approach as the decoupled strategy allows for easy addition and modification of the structure.
  • Using a front-end framework like Angular or React will result in a sophisticated, rich and dynamic web experience.
  • It is extremely developer-friendly coz they’re working on what they’re best at.
  • Recent blogs

    E-commerce for Enterprises with a large number of SKUs
    You know you have a good problem in hand when you have a large number of SKUs (Stock Keeping Units) on your bustling E-commerce...
    drupal project management
    Trying to manage a project without project management is like playing a game of football without a game plan. With a high workload...
    B2B E-Commerce
    There was a time when a supplier/wholesaler would generate a purchase order and send it via fax or email to the manufacturer. The...