PetaBencana
English
English
  • Introduction
  • General
    • Authentication
    • Versioning
    • Rate Limits
    • CORS
    • HTTPS
    • Coordinates
    • Error Codes
    • Content Types
    • Examples
    • Supported Area
    • Supported Hazards
  • Open API
    • Cards
    • Feeds
    • Flood Gauges
    • Flooded Area
    • Flooded Area/Archive
    • Flooded Area/Timeseries
    • Infrastructure
    • Crowdsourced Reports
    • Crowdsourced Reports/Archive
    • Crowdsourced Reports/Timeseries
    • Stats
      • Stats - Reports Summary
      • Stats - Flooded RWs Summary
      • Stats - Flooded Regions Summary
  • Authenticated API
    • Cards
    • Feeds
Powered by GitBook
On this page

Was this helpful?

  1. Open API

Feeds

PreviousCardsNextFlood Gauges

Last updated 4 years ago

Was this helpful?

Petabencana utilises data feeds from a number of third party sources. This endpoint allows the creation of data into the system for authorised users. Note: is required to post data through the /feeds endpoint.

POST /feeds/qlue

Add a report to the system from . The following attributes are supported for Qlue reports:

Attribute

Description

Format

Required

post_id

Unique qlue identifier for the report

Integer

Yes

created_at

Date and time the card was created

Yes

title

The title of the report being filed

String

No

text

Description of the disaster event

String

No

image_url

URL of the associated image

String

No

qlue_city

From which city was the report generated (must be one of jabodetabek, bandung, surabaya)

String

Yes

disaster_type

What type of disaster is being reported (currently only floodis supported)

String

Yes

location

Geographic location of the disaster event

Yes

Here is a simple call to POST a new Qlue report:

curl -X POST -H "X-Api-Key: API_KEY_GOES_HERE" -d '{
    "post_id":1234567802,
    "created_at":"2016-12-09T11:32:52.011Z",
    "image_url":"http://myimg",
    "qlue_city":"jabodetabek",
    "disaster_type":"flood",
    "text":"A big flood",
    "location": {
        "lat": -6.149531,
        "lng": 106.869342
    }
}' "https://data.petabencana.id/feeds/qlue"

Report was successfully created:

{
  "post_id": 1234567802,
  "created": true
}

The request was successful however the report already exists:

{
  "post_id": 1234567802,
  "created": false,
  "message": "1234567802 already exists in reports table"
}

Date ()

Lat/Long in

authentication
Qlue
ISO 8601
ESPG:4326