Skip to content

Instantly share code, notes, and snippets.

@albertodebortoli
Created November 17, 2012 22:11
Show Gist options
  • Save albertodebortoli/4100669 to your computer and use it in GitHub Desktop.
Save albertodebortoli/4100669 to your computer and use it in GitHub Desktop.
HelpEmotion
RESTful routes
GET /emergencies
POST /emergencies
GET /emergencies/:id
POST /emergencies/:id/offers
GET /emergencies
{
"emergencies": [
{
"id": string,
"loc": {
lon: number, // long
lat: number // lat
},
"type": string, // { earthquake | fire | flood }
"level": string, // { "slight" | "medium" | "serious" }
"intensity": number,
"timestamp": string // "2012-10-23T10:23:52Z"
},
...]
}
POST /emergencies
{
"emergencies":
{
"id": null,
"loc": {
lon: number, // long
lat: number // lat
},
"type": string, // { earthquake | fire | flood }
"level": string, // { "slight" | "medium" | "serious" }
"intensity": number,
"timestamp": string // "2012-10-23T10:23:52Z"
}
}
GET /emergencies/:id
{
"emergency":
{
"id": string,
"loc": {
lon: number, // long
lat: number // lat
},
"type": string, // { earthquake | fire | flood }
"level": string, // { "slight" | "medium" | "serious" }
"intensity": number,
"timestamp": string //"2012-10-23T10:23:52Z",
"people": [
{
"total": number,
"remaining": number,
"description": string,
"title": string //Primary key
}, ...
],
"material": [
{
"total": number,
"remaining": number,
"description": string,
"title": string //Primary key
}, ...
],
"money": [
{
"total": number,
"remaining": number,
"description": string,
"unitcost": number,
"title": string //Primary key
}, ...
]
}
}
POST /emergencies/:id/offers
{
"email": string
"offers": [
{
"type": "string", // { people | material | money }
"quantity": number, // se people default 1 (per chiarezza)
"title": string, // reference to primary key
},...
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment