|
Reports are retrieved by sending a HTTP GET request to the base URL with incidents as the task parameter. Only approved reports are fetched.
http://<deployment_url>/api?task=incidents |
Parameter | Description | Example |
---|---|---|
sinceid | Least report id that should be returned |
|
maxid | Maximum report id that should be returned |
|
incidentid | Retrieve a single report using its id |
|
locname | Get reports tagged with a specific location name |
|
locid | Get reports tagged with a location with the specified id |
|
cat name | Get reports that belong to a specified category name |
|
catid | Get reports that belong to a category with a id |
|
The reports request returns JSON with top-level fields payload, error.
Parameter | Description | Example |
---|---|---|
incidentid | ||
incidenttitle | ||
incidentdescription | ||
incidentdate | ||
incidentactive | Flag for report approved | 1=approved, 0=unapproved |
incidentverified | Flag for report verified | 1=verified, 0-unverified |
incidentmode | Method of report submission | 1=web, 2=sms, 3=email, 4=twitter |
locationid | ||
locationname | ||
locationlatitude | ||
locationlongitude |
A report is submitted by sending a HTTP POST request to the base URL with report as the task parameter. Additionally, the following parameters must also be specified
http://<deployment_url>/?task=report |
Parameter | Description | Example |
---|---|---|
incident_title | Title of the report |
|
incident_description | Description of the report |
|
incident_date | Date when the event being reported took place. The date format is mm/dd/yyyy |
|
incident_hour | Hour component of the time when the event took place. It must be in the 12 hour format |
|
incident_minute | Minute component of the time when the event took place. |
|
incident_ampm | Did the event take place in the AM or PM |
|
incident_category | The category id (or list of category ids) under which the report should be filed |
|
latitude | Latitude of the report's location |
|
longitude | Longitude of the report's location |
|
location_name | Name of the location associated with the report |
|
Parameter | Description | Example |
---|---|---|
person_first | First name of the person submitting the report |
|
person_last | Last name of the person submitting the report |
|
person_email | Email address of the person submitting the report |
|
incident_photo | Photo(s) to accompany the report | None |
incident_video | A video link (from YouTube, Metacafe, Vimeo etc) related to the report | |
incident_news | News links related to the report |
Categories are retrieved by sending a HTTP GET request to the base URL with categories as the task parameter. Only visible categories are fetched.
http://<deployment_url>/api?task=categories |
Parameter | Description | Example |
---|---|---|
catid | Get the category with the specified id |
|
Locations are retrieved by sending a HTTP GET request to the base URL with locations as the task parameter
http://<deployment_url>/api?task=locations |
Parameter | Description | Example |
---|---|---|
locid | Get a location using its id |
|
countryid | Get a location using the id of the country it belongs to (only applies where a deployment spans more than one country) |
|
Comments are retrieved by sending a HTTP GET request to the base URL with comments as the task parameter. In addition to the task parameter, the request URL must also specify the by parameter. The table below lists and describes the possible values for this parameter
Parameter | Description | Example |
---|---|---|
all | Gets all the comments |
|
reportid | Gets all the comments for a specific report. The report id must be specified. |
|
spam | Gets all the comments marked as spam |
|
pending | Gets all the comments awaiting approval (The admin must approve comments before they can be publicly viewable) |
|
approved | Gets all the approved comments |
|
Countries are retrieved by sending a HTTP GET request to the base URL with countries as the task parameter.
http://<deployment_url>/api?task=countries |
Parameter | Description | Example |
---|---|---|
countryid | Get a single country using its id |
|
coutryiso | Get a country using its ISO code |
|
countryname | Get a country using its name |
|
Custom forms are retrieved by sending a HTTP GET request to the base URL with customforms as the task parameter
http://<deployment_url>/api?task=customforms |
Parameter | Description | Example |
---|---|---|
all | Get all custom form ids | &by=all |
fields | Get custom form fields and values by incident id | &by=fields&id=0 |
meta | Get custom form definition by their form id retrieved with by=all | &by=meta&formid=0 |
Returns the version of Ushahidi running along with some key settings.
http://<deployment_url>/api?task=version |
The version api task returns an array of features supported by the deployment. Possible features returned are: