locomotivecms/engine — pull request #511 by alexsanford (2012-09-19 15:46:05+00:00)
Title: Locomotive API

The Locomotive API is now much more usable. You can perform all the CRUD actions on almost any resource in the system, and there are some conveniences built in as well. I haven't written any docs yet, but the cucumber features do a pretty good job of outlining all the functionality. I'm hoping to write a guide for the Locomotive doc site eventually.

Here's a quick example of the usage. First get an authentication token:

```
% curl -d 'email=author@example.com&password=mypassword' http://test.vcap.me:3000/locomotive/api/tokens.json
=> {"token":"uks6zqFgQQdhmWYfZxpf"}
```

Then simply use that token to access a resource:

```
curl http://test.vcap.me:3000/locomotive/api/pages.json?auth_token=uks6zqFgQQdhmWYfZxpf
```