Blog

Blesta 3.0: RESTful API (video)

January 11, 2012 | Posted by Cody


In this developer commentary, I give a behind the scenes look at the API in version 3.

What we’ve done is create a controller to make available all of the various models in a RESTful manner, using the four primary HTTP verbs (GET, POST, PUT, DELETE). All this controller needs to do is handle parameter passing and output formatting, which we’ve done here in just 342 lines. Available output formats are JSON, XML, and PHP serialization, but more may be added in the future.

The API supports an unlimited number of users, so you can delegate users for specific tasks. In addition, the API may be extended by plugins. The format for those requests is /api/pluginName.modelName/method.format.

Currently the API supports HTTP Basic authentication, but we’re looking to add Digest authentication in the future as well. In addition, we’ve added command line interface (CLI) support which is bound to make API development easier for you programmers out there.

Click the icon in the bottom right of the video player to go full screen.

Blesta 3.0: API Design

November 2, 2010 | Posted by Cody


This is the first article, in what will be a series for Blesta 3.0, our next major release. When we sat down to discuss the primary goals of Blesta 3.0, one of the first topics to come up was API design.  The two major issues we discovered with the original API design (of 1.0) were that:

  1. It was limited in its capabilities
  2. It was difficult and cumbersome to update

By implementing Blesta on top of an MVC framework (minPHP) we were able to create an automatic API, which eliminated both of these issues entirely.  Within an MVC application the model contains all of the business logic, so the only thing required to complete the API is a controller to handle access to the various models.  Since models are objects, the API controller can instantiate and access all of the public methods within a requested model.  This facilitates requests on logical objects that may perform specific actions.

In addition, the API controller could now fulfill requests in any number of various formats (e.g. json, xml, etc.).  The syntax was simple: /api/model/method.format.

The only thing necessary to complete the RESTful design were HTTP status codes, and the API controller easily handled those.  The result is an automatic RESTful API system, that not only grants access to the Blesta core, but to the back end of any plugins installed within that copy of Blesta as well.

In case you missed it, this means that ALL public model methods will be accessible through the API. We’re really excited about the new API and how much support it lends to developers.

Blesta 3.0 is currently in active development. A release date has not yet been determined.

Vision Helpdesk Integration

October 13, 2009 | Posted by Paul


Our friends over at Vision Helpdesk have been hard at work, they just launched v2.3.2 with Blesta integration! Now you can create invoices in Blesta directly from Vision Helpdesk, and I’m told they’ve got login share working too.

Vision Helpdesk is emerging as a leader is the support desk industry, and we recommend you check them out. They even have a free trial, so there is no obligation to buy.