Instead of using the CLI to test our API we can use the powerful Chrome REST Console plugin instead. This provides a nice GUI and makes it a little easier to both test and understand what is going on. In this lesson Joe looks at installing the plugin and making basic requests to our API using the REST Console interface.
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.
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.
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 series taught you how to use two of Drupal’s fundamental “building block” modules: Field and Views. These modules constitute the cornerstone of Drupal’s power and are used extensively throughout the rest of the Using Drupal series. In this summary we'll take a tour the Epic University site we've built to discuss how we built it. We'll wrap things up with a review of the modules and resources we've covered in this series.
Additional resources
When you’re uploading photos to a website, it’s important to ensure that they are displayed at the right size. Otherwise, when you upload an exceptionally large image, chances are good that it will break your site’s layout. To prevent this, you’ll want to scale these images so that they’re a consistent size, and create thumbnails for use in listing pages. Image styles are a feature that’s part of Drupal core’s Image module, and it provides these options and many more for displaying images. In this lesson we'll get an overview of the core image styles feature so that we understand how it works, which styles and effects we have to work with, and some tips for troubleshooting when your images don't display properly.
Additional resources
In this lesson, we take a look at our Band Wagon case study, and then we'll go through our implementation plan and see how we're going to tackle this one. In our case study, John and Lisa decide to make a website to share information about all the music they love, including videos, photos and reviews, and they want their friends have a voice on the site as well.
First of all, they need to be able to upload images to the site, and have an image that's small in one location but full-sized in other locations. We'll want to embed some videos, as well.
Their friends don't know how to write HTML, so we let them use a simple form to select media, and maybe reuse other people's images. We want to provide them with a WYSIWYG tool bar, an editor that helps them write HTML without coding.
How will this work? We'll use Drupal Core's Image Module and image styles, and expand the Media Module. For our WYSIWYG editor we're going to use the WYSIWYG Module, and then we're going to need to get an editor that we can plug into it.
Additional resources
In this lesson, we are going to see how the book relates to each of the series we have, and how each of the individual series are organized. We will end up with thirteen series to cover the entire book. Then we will take a look at how you should use the videos with the book. If you don't have the book, not to worry, as the book would only act as supplementary material to the video lessons. You don't need the book to successfully follow these series. If you do have the book however, we want to make sure you understand how the lessons and book relate to each other.
Additional resources
Using Drupal comes with source code intended to be used throughout the lessons to make following the lessons much easier. In this lesson we're going to take a look at what that source code provides for us, where we can get a copy of, and how to use it. We'll go through the installation process, as well as see how we can switch between chapters in the source code without destroying work you've done on previous chapters. It is important to note that using the source code is very important if you want the lessons to match what is in the lessons. Drupal modules can change a lot over time, and the source code is designed to exactly match what is covered in the lessons. Once you've learned the basics of a chapter by working through the source code, you can upgrade your modules and explore the differences in newer versions, with the base understanding you've gained from the lesson.
Warning: Since this Drupal code is several years old, you must use PHP 5.3. PHP 5.4 or higher will not work. You will need to make sure your server is using PHP 5.3 in order to use this code properly. Many all-in-one servers, like WAMP, MAMP, and XAMPP provide older versions of PHP and a way to switch back and forth between versions.
Additional resources
The Using Drupal series of lessons walks through the O'Reilly book, Using Drupal, written by Angie Byron, Addison Berry, and Bruno de Bondt. We use the second edition, which covers Drupal 7. The book starts off with taking a look at Drupal Core and then works through various case studies using a wide range of contributed modules from the Drupal project.
The video series follows along with what's in the book, so if you have the book, the videos are really great supplemental material. Even without the book, you’ll get the full lessons here in the videos.
This series is intended for people who have worked with the web and understand how a website gets delivered, and in particular, how to get a website onto a web server so that people can actually see it and use it. The rest of this introductory series we have here will look at how the book relates to the video series we're going to be creating, and how you can use those 2 together.
Additional resources
Once you have met all of the requirements and gathered the information you need, you can get down to the installation. This lesson assumes that you have already downloaded Drupal, placed the extracted files on your web server, and are able to create your database.
Additional resources
It’s not enough to just get Drupal installed; you also need to make sure to keep it up-to-date. New releases of modules and Drupal core come out periodically, most of which fix problems, some of which add new whiz-bang features, and some of which address critical security problems. In this lesson we will review Drupal version numbers and what they mean, review the core Update Status module, and then discuss using maintenance mode, and the update.php script.
Note: Not mentioned in the video is the fact that in addition to the user 1 account, you can also log in with any account that has the "administer software updates" permission enabled to run the update.php script.
Additional resources
Updating your site often sounds much scarier than the actual experience is. The most important step to remember is creating and testing backups of your site. In this lesson, we will create our backups, download a new version of Drupal core, and go through the process of updating our files and running the update.php script.
Note: Not mentioned in the video is the fact that in addition to the user 1 account, you can also log in with any account that has the "administer software updates" permission enabled to run the update.php script.