An API for Drupal
My friend Kin Lane recently got me interested in RESTful APIs, and posed to me an interesting challenge. He asked if I could build out a secured RESTful API as a Drupal module. This ended up being a learning experience on many levels, but I am happy to announce its completion.
In order to satisfy user needs, I built out two modules that provide interaction with the native object types of Pages and Articles that Drupal pre-defines. These modules each provide one of two dual layers of security that this project implements. The second layer will be discussed in a moment. I felt it important to, at the very least, provide a direct control mechanism at the application level for access to these powerful methods. To accomplish this I created a configuration screen that allows the site administrator to either enable or disable each function provided in the API.
The second layer of security is established with the help of 3scale.net. A third module is included in this project; the purpose of this third module is establish connection resources to the 3scale.net services for the other depending modules. The 3scale.net services provide for analytic services as well as access control to APIs that subscribe to the 3scale.net services.
These APIs establish straightforward CRUD functionality and leverages the fairly established REST integration practices. That is GET accomplishes the retrieval functionality, POST for create, PUT performs update, and DELETE obviously deletes.
Once these modules are downloaded and installed, activation of the 3scale service is simply a matter of entering the provider id into the configuration page of the 3scale connector module.