What is Drupal (8)?
Blog postWith the release of Drupal 8 approaching, it’s time again to answer and update the age old question: What is Drupal?
Drupalize.Me Podcast Episode 39
Blog postIf you are looking for good community event ideas, or just want to understand some of what goes into planning an event, check out this week's Drupalize.Me podcast on The Story of the TCD'O
Early Bat Gets Twice the Training
Blog postIn fewer than eight weeks DrupalCon will be upon us. Those registering for Breaking Down Component-Based Web Design before May 2nd will also receive a FREE annual membership from Drupalize.Me.
Heartbleed SSL Bug
Blog postAs you may know, a significant vulnerability in the popular OpenSSL cryptographic software library was discovered this week. Unfortunately this software library is used to encrypt most of the Internet, including the servers on which Drupalize.Me resides. But our team took immediate action to patch this bug, and our servers are no longer vulnerable. The same can be said for our payment processing software, which stores your financial information.
Release Day: Wrapping Up Web Services
Blog postThis week, we're wrapping up Joe Shindelar's latest series Building Web Services with Drupal 7. In these last four videos, you will learn how to use Views to build your API, how to create your own services resource in a custom module, and best practices for how to document your API. Next week, Emma Jane Westby guides you through the process of setting up Vagrant as a local development environment in her series Introduction to Vagrant.
All the power of views made available to your API. Really, what else is there to say? In this lesson Joe walks through installation and basic configuration of the services views module which provides the ability to expose views as resources via the services module.
Additional resources
In addition to using views to expose lists of things via our API we can also take advantage of views exposed filters to allow API consumers more control over the data they are receiving in a request. In this lesson Joe looks at accessing views exposed filters via REST requests by adding an exposed filter to both of the perviously created views and then walking through how the configuration of the view changes the behavior of the filter when used via the services API.
In addition to the built in support for core's data and actions the services module also provides a robust framework for exposing the data and actions of our custom modules as an API. In this lesson Joe writes a basic module which creates a custom resource for saving and retrieving a "checked in" status for an authenticated user.
Example commands:
Check a user's status
curl http://localhost/demos/services-7x-test/docroot/api/v1/drupalsquare/1 -H "Accept: application/json"
Check-in a user
curl http://localhost/demos/services-7x-test/docroot/api/v1/drupalsquare/checkin -X POST -H "Content-type: application/json" -H "Accept: application/json" -d '{"uid":1}'
Additional resources
An API that exposes data and actions to a 3rd party is only as good as the documentation for that API. Without good documentation no one will be able to make use of the API you just spent so much energy creating. In this lesson Joe shows some of his favorite API documentation examples and then walks through creating some basic documentation for the resource we created in the previous lesson.
Additional resources
Example - GitHub API Documentation
Example - Recurly Documentation
http://apiary.io - tool to assit in writing good documentation
This week, you'll take your HTTP response and request skills to the next level as you learn how to tackle common use cases such as filtering returned data to get only what you need and authenticating requests to get data behind a login. In this installment of our series, Building Web Services with Drupal 7, Joe Shindelar will walk you through how to query, test, and authenticate your D7-backed web services.
In this lesson Joe will demontrate using additional parameters and arguments to refine the returned data when making requests from our API. As well as walking through the code that shows where the various parameters are defined and how you can find what options are available. Finally, we install the services tools module which provides some additional documentation.
Additional resources
Services implements resources for all of core's basic data types but sometimes the information returned in the response is either to much or to little and we want to make changes to the response data. In this lesson Joe will look at how we can write a simple custom module that implments basic hooks provided by the services module to allow us to alter the response returned by a request to the node resource.
Most of the actions we want to perform and data we want to retrieve from an API is likely restricted to authenticated users. This lesson will outline the process of making an authenticated request and walk the user through the configuration that is required for our services endpoint in order to start allowing session based authentication.
In this lesson Joe walks through making authenticated requests to our API with cURL. Although cURL can be a bit verbose when making authenticated requests it serves as a good way to talk about all the headers that are a required and a lowest common denominator for how you could accomplish authentication in just about any language or application.
Example commands
curl http://services-demo.lan/api/v1/user/login -d '{"name":"admin","pass":"admin"}' -H "Content-type: application/json" -H "Accept: application/json"
curl http://services-demo.lan/api/v1/system/connect -X POST
curl http://services-demo.lan/api/v1/system/connect -H "Cookie: SESS60f8c5b86739b7e326223b4ef35867b2=A86XHGJWlnDcMOGcArbOT-qHrsIi5P2NrcoNTXwWluw" -H "X-CSRF-Token: T77haXwD7JKOJsBlKP3p3kLbjQO96bQWvGJAE1_PUZM" -X POST
curl http://services-demo.lan/api/v1/user/login -X POST -H "Content-type: application/json" -H "Accept: application/json"
In this lesson Joe walks through making authenticated requests using the Chrome REST Console Plugin
Additional resources
The Chrome plugin demonstrated in this video is no longer available but there are many alternatives available. Use Postman or search for "REST client" to find tooling options.
As mentioned in my previous blog post "Catching the Community Train" Lisa, Bojhan and myself will be working on a website to better facilitate the process of designers contributing to Drupal. Following my last blog post we sent out a questionnaire to current and previous contributors in order to gain some valuable insights that will help us move forward. In this blog post I will analyze the answers we received and share what they mean to me and how they will be instrumental in our success of helping designers more easily get involved in Drupal.
Drupalize.Me Podcast Episode 38
Blog postIn this week's Episode 38: Lessons from Distributed Companies, we talk to a few attendees of the Yonder conference about what it means to be a distributed compa
Are you ready to dive into creating RESTful Web Services? In this next set of videos on Building Web Services with Drupal 7, Joe Shindelar provides an overview of the Services UI in Drupal 7 and shows you how to set endpoints, enable resources, and test those resources using cURL on the command line and the Chrome REST plugin.
This lesson walks through defining the URL that will serve as the endpoint for your API as well as all the basic configuration for your new services endpoint with the exception of resource configuration which is covered in the following lesson.
Additional resources
The services module exposes most of Drupal core's data as resources and provides CRUD operations and additional actions for each. In this lesson Joe will look at the available resources, talk about the various CRUD operations and actions and then enable the node resource and demonstrate retrieving node data as JSON from the services endpoint.
Additional resources
JSON Formatter - Chrome plugin to display results of a JSON request in a nicer way.