Cards
Petabencana report cards for disaster events. Note: authentication is required to make updates to cards.
Request Format
URL Parameter | Description | Format | Required |
cardId | Unique identifier of the card we wish to work with, this is generated by the system when the initial card is created (required) | String (7 to 14 characters) | Yes |
Attribute | Description | Format | Required |
card_data | User data collected in card interface | JSON | Yes |
text | Description of the disaster event | String | No |
image_id | Identifier of the associated card image | String | No |
created_at | Date and time the card was created | Date (ISO 8601) | Yes |
location | Geographic location of the disaster event | Lat/Long in ESPG:4326 | Yes |
Note on card_data
Card data requires the object report_type
to exist. Where disaster_type
is set to 'flood' then the object flood_depth
should also exist adjacent to report_type
. Where the disaster_type
is 'prep' then report_type
should be one of the types as specified in server config.js.
Disaster Type | report_type | Attribute details |
Flood | flood | flood_depth: flood severity based on depth in cm < 70 cm : Minor 70 - 150 cm : Moderate 150 cm : Severe |
Earthquake | road | accessabilityFailure: the level of road damage affected by earthquake 0 : < 0,5 m (No Vehicle Access) 1 : 0,6 - 1 m (2-Wheel Vehicle Access) 2 or 3 : 1.1 - 1.8 m (4-Wheel Vehicle Access) 4 : >1,9 m (Large Vehicle Access) |
Earthquake | structure | structureFailure: the level of structure damage affected by earthquake 0 : Cracking 1 : Partially Collapse 2 : Fully Collapse |
Extreme Wind | wind | impact: level of disruption caused by extreme wind 0 : Low Disruption 1 : Medium Disruption 2 : High Disruption |
Haze | haze | visibility: the distance one can see as determined by light and weather conditions 0: can see but need to wear a mask 1: can see but not clean enough to drive 2: can barely see, too dangerous to go out airQuality: described by symptoms felt by humans 0 or 1: Poor Air Quality 2: Severe Air Quality 3 or 4 : Hazardous Air Quality |
Forest Fire | fire | fireRadius: the radius of a forest fire estimated by the human eye |
For example a card with flood data including flood_depth:
Or, a card with pre-flood data report regarding a drain.
GET /cards/:cardId
Retrieve details of a card:
Here is a simple call to GET a card:
The card was found:
The card does not exist:
PUT /cards/:cardId
Update a card with details a disaster event report:
Here is a simple call to PUT a card:
Card was successfully created:
The card does not exist:
The report already exists for the card:
GET /cards/:cardId/images
GET a signed S3 URL to upload a card report, this must be done after the card report has been created and only one image can exist for a given card.
NOTE: After an image is submitted a server-side process shrinks the image to a standard size and there may be a small time lag of a few seconds before the image goes "live".
Here is a simple call to GET a new signed S3 URL for image upload:
Signed S3 URL successfully generated:
Last updated