The rails server exposes a JSON API. All API endpoints are prefixed by /api/v1
.
Lists all locations that are countries
topojson
- if present, the location's topojson structure will be sent with the object.
Lists all locations that are regions
topojson
- if present, the location's topojson structure will be sent with the object.
Retrives World Bank demographic information (population and gdp) per country, per year.
startYear
endYear
Collection is serialized as an object with country codes as keys.
Retrives World Bank demographic information (population and gdp) per country, per year.
startYear
- show results from this year onwardsendYear
- show results up to this year
Retrieves metadata of the historical emissions dataset. This metadata is the list of data_sources
, sectors
, gases
, locations
and gwps
. All these parameters are filters in the /emissions
endpoint
Collection is serialized as an object with the metadata entity as key.
Retrieves time series data for historical emissions.
source
- emission data source id (cait, pik, wb)gas
- emission gas idsector
- emission sector idgwp
- emission gwp idlocation
- location iso3 codedate_after
- show results from this year onwardsdate_before
- show results up to this year
Note: all these parameters accept multiple values, separated by commas.
source
query parameter is mandatory, together with at least one of location
, sector
or gas
.
Lists all known NDC texts
query
- Free text search (lists snippets)
The following parameters can be used to search sdg linkages' snippets of text (lists snippets in the original text).
target
- NdcSdg target numbergoal
- NdcSdg goal numbersector
- NdcSdg sector number
Shows NDC texts for the country given by the :iso parameter
query
- Free text search (highlights snippets in the original text)
The following parameters can be used to search and highlight sdg linkages' snippets of text
target
- NdcSdg target numbergoal
- NdcSdg goal numbersector
- NdcSdg sector number
Shows the relations between all SDG metadata (targets, goals and sectors)
Collection is serialized as an object with the metadata entity as key
Shows linkage data for the given country code.
Shows an overview of linkage data to meet specific front-end requirements.
Lists NDC indicator information
-
filter
- Filter by category type (global, overview, map) -
category
- Filter by global category name -
location
- Filter by location iso code3. Accepts multiple values separated by commas.
Collection is serialized as an object with embedded metadata (categories
and sectors
keys). NDC data is inside the indicators
key, where the collection is again an object with country iso codes as keys.
Shows an overview of the given country's indicators, tailored to meet specific frontend needs.
Lists adaptation indicator data
location
- Filter by location iso code3. Accepts multiple values separated by commas.
Lists quantification data, representing NDC emissions targets.
location
- Filter by location iso code3. Accepts multiple values separated by commas.
Shows socioeconomic data for the given location iso
code.
Lists all acronyms from the metadata dataset
Lists all attribution data from the metadata dataset
Shows the attribution data for the given source
Lists all timeline data
Shows timeline data for the given location iso
code
limit
Shows the current user's information
Creates a new user in CW and links it to the Control Tower user
user[ct_id]
- The ID from Control Tower
All these requests expects a header to identify the user, returning a 401
error if not provided.
Lists all the stories of the current user
Shows the story with the given id (as long as it belongs to the user, otherwise it returns 403)
Returns a json
with the created story if successfully created or 422
if there was an error (and the reason for failing)
-
title (string) MANDATORY - The title of the story
-
body (json) - The body of the story
-
public (boolean) - The privacy of the story
Returns a json
with the updated story if successfully created or 422
if there was an error (and the reason for failing) or 401
if the user doesn't have permission to edit the story
-
user_story[title] (string) MANDATORY - The title of the story
-
user_story[body] (json) - The body of the story
-
user_story[public] (boolean) - The privacy of the story
Removes the story and returns 200
if it worked or 401
if the user doesn't have permission to delete the story
All these requests expects a header to identify the user, returning a 401
error if not provided.
List all the visualizations of the current user
Shows the visualization with the given id (as long as it belongs to the user, otherwise it returns 403)
Returns a json
with the created visualization if successfully created or 422
if there was an error (and the reason for failing)
-
visualization[title] (string) MANDATORY - The title of the visualization
-
visualization[description] (text) - The description of the visualization
-
visualization[json_body] (json) - The body of the visualization
Returns a json
with the updated visualization if successfully created or 422
if there was an error (and the reason for failing) or 401
if the user doesn't have permission to edit the story
-
visualization[title] (string) MANDATORY - The title of the visualization
-
visualization[description] (text) - The description of the visualization
-
visualization[json_body] (json) - The body of the visualization
Removes the visualization and returns 200
if it worked or 401
if the user doesn't have permission to delete the story