API Documentation

From UNHCR
Revision as of 16:27, 1 October 2015 by HQ Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


REST API Resources

Instances

Instances are versions of the application that are currently deployed.

Resource Description
GET instances/list Returns all instances that are currently deployed in a production environment.
GET instances/show/:id Retrieves the information for the instance represented by the given id.

Countries

Resource Description
GET countries/list Returns a list of names of countries and the country code
GET countries/regions Returns a list of geographic regions and their countries
GET countries/show/:id Retrieves region information of all countries from the instance id.

Regions

Resource Description
GET regions/show/:id Retrieves settlement information of all regions from the instance id.

Population

These methods allow you to get information about populations in an application.

Resource Description
GET population/regional/:instance_id Returns population data for a specified instance or all instances
GET population/countries/:instance_id Returns population data for all countries in a specified instance or all instances
GET population/regions/:instance_id Returns population data for all regions in a specified instance or all instances
GET population/settlements/:instance_id Returns population data for all settlements in a specified instance or all instances
GET population/search Returns population data based on instance id, population level and name of population level
GET population/search_all_instances Returns population data from any instance that matches the name value

Documents

Documents are any type of file (pdf, jpeg, doc, etc.) that has been uploaded to an instance.

Resource Description
GET documents/countries Returns all countries (from all instances) that have uploaded documents
GET documents/documents/:country_code Retrieves uploaded documents for a country or all countries

Who's Doing What Where

These methods allow you to get information who's doing what where.

Resource Description
GET whos_doing_what_where/regional/:instance_id Returns who's doing what where data for a specified instance or all instances
GET whos_doing_what_where/countries/:instance_id Returns who's doing what where data for all countries in a specified instance or all instances
GET whos_doing_what_where/regions/:instance_id Returns who's doing what where data for all regions in a specified instance or all instances
GET whos_doing_what_where/settlements/:instance_id Returns who's doing what where data for all settlements in a specified instance or all instances

Statistics

These methods allow you to get population statistics reference data.

Resource Description
GET stats/country_of_residence Returns a list of countries of residence
GET stats/origin Returns a list of origins
GET stats/country_of_asylum Returns a list of countries of asylum
GET stats/persons_of_concern Returns statistics for persons of concern
GET stats/time_series Returns statistics for time series persons of concern
GET stats/demographics Returns statistics for demographics of persons of concern
GET stats/asylum_seekers Returns statistics for asylum seekers of persons of concern
GET stats/time_series_population_types Returns time series' population types
GET stats/time_series_years Returns time series' year
GET stats/time_series_all_years Returns statistics for time series data for all years
GET stats/mediterranean/countries Returns a list of mediterranean countries
GET stats/mediterranean/monthly_arrivals_by_country Returns a list of arrivals by country
GET stats/mediterranean/monthly_arrivals_by_location Returns a list of arrivals by location
GET stats/mediterranean/arrivals_by_year Returns a list arrivals by year
GET stats/mediterranean/origin Returns a list of origin and asylum countries
GET stats/mediterranean/demographics Returns demographics related to Mediterranean countries (men, women, children)
GET stats/mediterranean/deaths Returns a list of deaths by year