Getting Started with External REST APIs in Drupal

joelsteidl

A requirement to integrate Drupal with an external service can be intimidating. Chances are, your Drupal project will require integrating a 3rd party CRM or an app that does something really specific; like allowing users to sign documents digitally. 

Whatever the case may be, Drupal excels at integrating with external web services. Drupal 8 adopted an industry standard PHP library called Guzzle. Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and integrate with web services.

After this session, you'll walk away with:

  • Getting started with httpClient (Drupal's wrapper around Guzzle) to consume external APIs
  • Creating a Drupal Service for reusing API calls
  • Securing sensitive data like API credentials using the Key Module
  • Implementing webhooks to accept data being pushed to you

We'll have some fun looking at a couple real world APIs and provide code that you can use on your next project. After you get your first taste, you’ll want every project to have some sort of integration.
 

Program tags

apis, back end development

Experience Level

Intermediate

Drupal Version