Interacting with the json api via curl:
curl -i -X POST -H "Content-Type:application/json" -d '{ "user": { "email": "[email protected]", "password": "password" } }' http://localhost:3000/sessions
yields auth_token: {"user_email":"[email protected]","auth_token":"xxx"}
curl -i -X GET -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists
yields: [{"id":9,"title":"List Title 1","created_at":"2015-08-28T16:52:03.522Z","updated_at":"2015-08-28T16:52:03.522Z"}, ...]
curl -i -X GET -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists/1
curl -i -X POST -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" -d '{ "list": { "title": "another new list title"} }' http://localhost:3000/lists
curl -i -X PUT -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" -d '{ "list": { "title": "updated list title"} }' http://localhost:3000/lists/1
curl -i -X DELETE -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists/1
curl -i -X GET -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists/1/items
curl -i -X GET -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists/1/items/1
curl -i -X POST -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" -d '{ "item": { "title": "a new item", "complete": "false"} }' http://localhost:3000/lists/5/items
curl -i -X PUT -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" -d '{ "item": { "title": "an updated item title"} }' http://localhost:3000/lists/1/items/1
curl -i -X DELETE -H "Content-Type:application/json" -H "X-User-Email:[email protected]" -H "X-Auth-Token:xxx" http://localhost:3000/lists/1/items/1