RSS Valid
XHTML Valid
CSS Valid

ASRA ~ A Simple RESTful API

ASRA is a lightweight package that assists in the rapid development of simple APIs for exporting data for Flash, Flex or other applications.

Through the use of pretty urls, you can create an export system that automatically handles xml, json, serialized, yaml, or vars output. You merely have to define some basic MySQL queries or use the built-in query methods to define data sets. How you access the URL determines the type of data exported.

From the root of the API folder, urls basically work like so:

/type/controller/method/param

An example URL to export a photo by id as json then might be:

/json/photos/id/1

Content is exported/imported through the use of controllers. The system itself is similar to an MVC pattern. That is if you think of how you want the output to display (XML? JSON? YAML?) to be the "V" and the custom queries to be the "M" ;). No, there is no database abstraction here. Merely a quick way to export data from a MySQL database in many different formats by only writing a few simple queries (and sometimes none at all!).

Features include...

  • results in xml, json, serialized, var=value pairs, yaml
  • results caching
  • easy subquerying for selecting simple associations into a result set
  • database configuration similar to Zend_Config_Ini for easy Zend Framework integration
  • Textmate bundle for ASRA snippets
  • Debugging and query logging
  • More and more to come...

Availability

We'd love to hear about your project! Please see the services and contact sections for more information or for work inquiries.