Created
November 17, 2012 22:11
-
-
Save albertodebortoli/4100669 to your computer and use it in GitHub Desktop.
HelpEmotion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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