Drupalize.Me Podcast Episode 41
Blog postIn Episode 41, Virtualization with Vagrant, Emma Jane Westby and Erika Heidi chat about creating virtual environments with Vagrant. Through their light-hearted approach to technical topics, we hope Emma and Erika are able to make Vagrant seem a little more accessible, if not downright fun.
The concept of blocks has been around in Drupal since the earliest versions. Chunks of information that can be placed into the regions provided by a theme and re-used throughout your site. The system for defining blocks in code has changed quite a bit for Drupal 8 though so it's worth taking a fresh look at how to create blocks in your own module. Especially since in my experience it's one of the first things we need to know how to do as module developers.
Webinar: Easily Create Maps with Leaflet
Blog postCurious about Leaflet? Join Drupalize.Me Trainer Amber Matz for a live tutorial on how to add Leaflet maps to your Drupal site during this Acquia hosted webinar on May 1, 2014 at 1:00 PM EDT.
Hiding Form Fields in Drupal 8
Blog postIf you have worked with the Field UI in Drupal 7 you will know that you are able to prevent fields from being displayed when viewing entities (e.g. content, users etc).
Dupalize.Me Podcast Episode 40
Blog postEver wonder what it means to host your site in "the cloud"? This week's Drupalize.Me podcast, Drupal in the Cloud, uncovers these mysteries. We discuss: what differentiates cloud providers; what it takes to get Drupal in the cloud; and what the future of cloud computing looks like.
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.