/api/events
/api/runs
/api/teams
The general workflow goes as follows:
- Create a team - get your token
- For each time you test, create a run using your team token - get a run token
- For each step in your machine, report your progress using your run token
- When you're done, report that you're done using your run token
- Rinse and repeat!
tl;dr - Create a new run every time you run your machine!
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"team":{"name":"Team 1"}}' http://rube-goldberg.herokuapp.com/api/teams
This will give the JSON response of:
{"result":"success","team_token":"faff5dd68de774c6aaceacba33eb48"}
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"team_token":"faff5dd68de774c6aaceacba33eb48"}' http://rube-goldberg.herokuapp.com/api/runs
This will give the JSON response of:
{"result":"success","run_token":"142b86150dc4d346709bc5bb261e69"}
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"run_token":"142b86150dc4d346709bc5bb261e69","event":{"event_type":"progress","title":"Twitter","description":"Sending Tweet: \"You rock @quickleft!\""}}' http://rube-goldberg.herokuapp.com/api/events
This will give the JSON response of: {"result":"success"}
You need to complete your run once things are over and done with. It's basically the same as sending a progress event, but you need to use an event_type
of end
.
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"run_token":"142b86150dc4d346709bc5bb261e69","event":{"event_type":"end","title":"Twitter","description":"Sending Tweet: \"You rock @quickleft!\""}}' http://rube-goldberg.herokuapp.com/api/events
This will give the JSON response of: {"result":"success"}
Any of the endponts will return a response of {"result":"failure"}
plus an errors hash if there are any problems.
Nick Messick (@messick)
Alex McPherson (@alexmcpherson)
Bob Bonifield (@bbonifield)