Understanding Networks: RESTful API

update

assignment week1/2

Decide on your application, then describe and sketch the control surface and the specify the REST interface. Describe your application and present your REST API. Don’t build the project, just describe it and its functions. Write a blog post detailing this description. You’ll be assigned someone else’s specification to build this week.

concept

Inspired by the playfulness and shared group experience of parties Sandy, Kellee and I decided to create an interactive and RESTful Limbo-Stick.

context

A little bit of research on the origins of Limbo showed that the dance is considered the unofficial national dance of Trinidad & Tobago, together with steel drums and calypso as national heritage. In its original form the bar is raised slowly from the lowest levels, resembling the entry of death into life. When the dance gained more popularity this form was flipped - dancers are starting now high and the bar slowly lowers.

system overview

 
 

physical interface (draft)

Usual limbo setups look like our rough sketch:

 
 

RESTful API

For the RESTful API for the dance/game we followed an example to define our five basic states: “off”, “on”, “height adjustment”, “idle”, “collision”.

POST-requests

//*On/Off Mode*
POST /switchMain/{bool} 
//value: 1 to turn it on,  0 to turn limbo stick off

//*Height Adjustment Mode*
POST /height/{bool}
// Value: 1 to lower the height of the limbo stick one step on the predefined scale, 0 to keep current position

//*Collision Mode*
POST /collision/{bool}
//value: 1 if collision is detected, 0 if no collision is detected

//*Alarm Mode
POST /alarm/{bool}
//Value: 1 to turn it on, 0 to turn alarm off

//*Home Mode*
// If POST /height counter  > 6, go into home mode:
POST /home/{bool}
//value: 1 to home the stick to highest position on the predefined scale, 0 to keep it current position

GET-request

GET /state/

//returns
{
  "switchMain": {0, 1},
  "height": {0, 1},
  "collision": {0, 1},
  "alarm": {0,1},
  "home": {0, 1}
}

physcial interface/controller

 
Screen Shot 2018-11-19 at 8.08.17 PM.png