Oct 17 2011
Oct 17

RESTful is the native API of web browsers. When you put some website’s address into a browser, that’s an implied REST expression called a “GET” of the resource at that address. In response to that GET request, the web server on the other end returns a web page. However, REST is much more than requesting the resource (data) at some address. Just like using any website, one is able to Create things, Retrieve them afterwards, perform Updates to them, and eventually Delete them. That Create -> Retrieve -> Update -> Delete cycle is called “doing CRUD” (really), and that in a nutshell is what creating and using a RESTful system is all about.

In the “early days” of the Internet, when someone wanted to make a printer or some other machine programmatically communicate over the Internet, more complex systems with names like SOAP, XMLRPC and AMF were used to handle that communication. Then around the year 2000, a smart guy named Roy Fielding pointed out that the web itself was an API and these complex systems were not only a bother to create and work through, but needless because what they were offering was already built into the web itself.

Now, Drupal is a content management framework whose essential purpose is to create a website of some sort. You are probably familiar with some websites including information from other websites, such as a Twitter feed or Facebook friend status. This including of other website’s information can be accomplished “the old, hard way” via scraping the page that normally shows this data, via SOAP/XMLRPC or that communicating of information can be accomplished “the new, shiny RESTful way” which takes less effort and by it’s nature is universally supported.

This is essentially machine-to-machine communications, and is how an iPhone/iPad/Android/game console/printer or virtually any other device communicates on the Internet. This is using REST.

The topic of our Developing RESTful Web Services and APIs class is how to use the new Services 3.0 module. Services 3.0 provides an API for Drupal module developers to create a REST API of their own design. Using Services it’s most basic level, one can install and enable a set of built in APIs that will allow remote programmatic administration of that website (thru secured authentication of course!) What I detail is the more ambitious creation of a series of programmatic resources, demonstrating how to create a useful API of the type that could support anything capable of programmatic control.

For example, you could have a site where you provide users “alerts” when items the users have shown interest become available. Additionally, those alerts can be seen on Facebook and in an iPhone app. Your Drupal site providing these alerts can use a custom module and Services to publish an example.com/alerts/uid API that the Facebook and iPhone apps use to manipulate that information. Using REST for this communication is more lightweight on your web server because the Facebook and iPhone app logic is able to request that information specifically, rather than an entire web page where they would scrape off the data they want, or get that information through the more complex SOAP or XMLRPC methods.

This is also how one could have a mobile and/or console game’s universal high scores and user community forums present in-game as well as simultaneously on the web. One could have a Drupal site using Services to publish an API for “doing CRUD” with high scores and interacting on the community forum. For the Drupal site, business as usual, but for the mobile and/or console game they are getting that data via a RESTful communication with the Drupal site. For the mobile and console game developers, this type of communication is easy. And through Services, it’s also easy for the Drupal developer.

Further, I use Services to create “custom on-demand digital products” at a Drupal/Ubercart store, with that on-demand creation taking place on a remote cloud server. I walk through how that is setup, and my architecture for scaling the environment should my custom digital products go viral.

And the best part, REST is how one creates Web Services. What are Web Services? They are the future of everything. Really. Remember up there where I mention machine to machine communication? Web Services are the creation and publishing of APIs to “do CRUD” with things that people care enough to pay real money for access. Such as access to commercially controlled data like music, movies, or even stock and bond research and trading. Web Services is taking REST and wrapping it in commercial activities. Some event venue could publish a ticketing API, and then charge ticket brokers for access. The list of possibilities are endless. And that list is expected to be how all commercial services in the future will be conducted. (Make your eyes really big when you read that last part :)

In summary, our Developing RESTful Web Services and APIs class covers how to create an API with Services 3.0, as well as how to support your API customers (who may not be using Drupal) (and who may be dumb as rocks) how to successfully use your site’s API.

At the class, I give out and walk through an API Shell, which took over a month to create. Next, students begin creating their own API with architectural guidance by myself and other Larks trainers. To facilitate this, an example API’s is step-by-step created, with time for the students to implement their component in their API as we go along. For individuals or groups with a specific project they are planning or have in development, a 3rd day of additional guidance and support is also available.

Oct 03 2011
Oct 03

To celebrate today’s release of Services 3.0 for Drupal 6 & 7, we sat down for an interview with Blake Senftner, a Services expert who is providing our Developing RESTful Services and Web APIs training in Los Angeles on November 3, 4 & 5.

We’re also offering 10% off this training: just use coupon code SERVICES10 at checkout. The discount code expires on October 15th.

Christefano: What was it that got you interested in Services?

Blake: Well, to be honest it’s because of Services and Drupal’s other APIs that I’m using Drupal at all. I come from a 3D animation background — I did both feature films and console video games — and I needed the ability to create Web APIs for a distributed computing environment for my own startup.

C: When was that?

B: I started working with Services 6.x and the XMLRPC Server, getting the first version of my distributed environment operating with that. It worked fine and I wasn’t looking forward to the move to RESTful until a buddy at Disney Interactive sat me down and explained REST to me.

With XMLRPC, you create remotely callable functions and the logic feels very “atomic” in that you’re doing one function at a time, with no “system” or architectural framework. Within a RESTful structure, though, you’re creating and working with “resources” — which are very much like objects in an object oriented sense. Where XMLRPC is working in data, REST works on “things” that have a complete CRUD lifecycle — create, review, update, and delete operations. Just that simple CRUD framework provides a structure that makes working in REST conceptually easier.

C: Give an example of how using REST makes things easier.

B: Okay, an example would be with my XMLRPC service, I had a function that could create a 3D model. That was all it did. The same thing in REST by default supports creating, editing, deleting and updating. Just because that comes with REST and is part of the concept of REST, you automatically think in lifecycle frames of references. With an XMLRPC, all you think of is “I just want this one item.” There’s no architecture in that. There’s no lifecycle in that.

Oh, I also had a client that saw my earlier XMLRPC API and wanted something exponentially more sophisticated. Envisioning that in XMLRPC was causing me to consider a CRUD framework for XMLRPC, but luckily my buddy at Disney had that talk with me. That’s why I switched to REST.

C: When did you start working with Services 3.x?

B: I was digging through the sources, examples and issue queue as soon as a usable 3.x version was available. That was probably around September or October of last year. There may have been working versions earlier than that, but that’s when I started. The maintainers of the Services project are amazing and overworked and I hope the training we’re doing helps alleviate their workload.

C: How long did it take you to get your first “hello world” working?

B: Oh, geez. [Blake checks his email.] It looks like it was just shy of 4 weeks before I had satisfactory handshaking and then another 6 weeks before I had a full CRUD resource working with Relationships, Actions, Targeted Actions, and Authentication. Of course, I was also developing my client’s project at the same time, but the Services work was a continual focus because we had so much riding on it working.

That’s a big reason behind my offering this training. I speak with Drupal developers all the time at my Droplabs co-working space, and very few of them have the time or clients with the vision to commit the time to learn Services. Services is the key behind offering “software as a service”, as well as backends for mobile apps and console games.

C: We’re really excited to be doing this training. What do developers need to know in advance, and what do they need to bring to the training when they sign up?

B: You probably need to know at minimum how to create a basic Drupal module. To make anything interesting, you probably want to know enough to create a Forms API-driven interaction. It could be creating a custom content type or anything that exposes forms from your module. If you know that, you have everything you need to jump into Services with gusto.

Bring a laptop with a local development installation or a way to remotely access a Drupal installation where you’re a server admin and can install and deploy modules. It can be Drupal 6 or Drupal 7. Your choice.

C: Thanks for answering all my questions!

B: Sure, I hope it’s helpful. I look forward to developing with you!

Exaltation of Larks is providing this 3-day training (2 days of classroom-style training with an optional third day of hands-on mentorship on student projects) on November 3, 4 & 5, 2011. If you have any questions, visit us at http://www.larks.la/training or contact us at trainings [at] larks [dot] la and we’ll be happy to talk with you. You can also call us at 888-LARKS-LA (855-527-5752) with any questions.

Sep 22 2011
Sep 22

Tomorrow is the last day of Summer but the Drupal training scene is as hot as ever. We’ve scheduled a number of trainings in Los Angeles this Fall that we’re excited to tell you about, and we’re happy to publicly announce our training assistance program.

First, though, we’re sending out discount codes on Twitter and Facebook. Follow @LarksLA on Twitter, like Exaltation of Larks on Facebook or sign up to our training newsletter at http://www.larks.la/training to get a 15% early bird discount* toward all our trainings!

Los Angeles Drupal trainings in October and November, 2011

Here are the trainings we’ve lined up. If you have any questions, visit us at http://www.larks.la/training or contact us at trainings [at] larks [dot] la and we’ll be happy to talk with you. You can also call us at 888-LARKS-LA (888-527-5752) with any questions.

Beginner trainings:

Intermediate training:

Advanced trainings:

All our trainings are $400 a day (1-day trainings are $400, 2-day trainings are $800, etc.). We’re excited about these trainings and hope you are, too. Here are some more details and descriptions.

Training details and descriptions

   Drupal Fundamentals
   October 31, 2011

Drupal Fundamentals is our introductory training that touches on nearly every aspect of the core Drupal framework and covers many must-have modules. By the end of the day, you’ll have created a Drupal site that looks and functions much like any you’ll see on the web today.

This training is for Drupal 7. For more information, visit http://ex.tl/sbd7

   Drupal Scalability and Performance
   October 31, 2011

In this advanced Drupal Scalability and Performance training, we’ll show you the best practices for running fast sites for a large volume of users. Starting with a blank Linux virtual server, we’ll work together through the setup, configuration and tuning of Drupal using Varnish, Pressflow, Apache, MySQL, Memcache and Apache Solr.

This training is for both Drupal 6 and Drupal 7. For more information, visit http://ex.tl/dsp1

   Drupal Architecture (Custom Content, Fields and Lists)
   November 1 & 2, 2011

Drupal Architecture (Custom Content, Fields and Lists) is our intermediate training where we explore modules and configurations you can combine to build more customized systems using Drupal. You’ll create many examples of more advanced configurations and content displays using the popular Content Construction Kit (CCK) and Views modules.

This training is for Drupal 6. For more information, visit http://ex.tl/ccfl1

   Developing RESTful Web Services and APIs
   November 3, 4 & 5, 2011

Offered for the first time in Southern California, Developing RESTful Web Services and APIs is an advanced 2-day training (with an optional third day of additional hands-on support) for those developers seeking accelerated understanding of exploiting Services 3.0 to its fullest. This is THE training you need if you’re using Drupal to create a backend for iPad, iPhone or Android applications.

This training covers both Drupal 6 and Drupal 7. For more information, visit

Training assistance program

In closing, we’d like to tell you about our training assistance program. For each class, we’re setting aside a limited number of seats for students, unemployed job seekers and people in need.

For more details about the program, contact us at trainings [at] larks [dot] la and we’ll be happy to talk with you. You can also call us at 888-LARKS-LA (888-527-5752) with any questions.

* Our early bird discount is not valid toward the Red Cross First Aid, CPR & AED training and 2-year certification that we’re organizing. It’s already being offered at nearly 33% off, so sign up today. You won’t regret it and you might even save someone’s life. ^

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web