Public API - a-thousand-channels/ORTE-backend GitHub Wiki

Available endpoints

The public API endpoints of ORTE-backend are built to provide data to custom applications (clients). Currently there are 5 endpoints available without any authentication, all of accessible them via GET requests.


maps#show

GET /public/maps/:id

The maps#show endpoint returns JSON data for a published map, its associated layers and the places on those layers with their associated data.

The :id param can be the numeric ID or the slug of the map.

If no published map with that ID or slug exists, a 403 Forbidden error with message "Map not accessible" is returned.

If the map has published layers, those are part of the response with their associated images and all the places that are marked as published with their associated objects (i.e. tags, images and annotations). Additionally, the relations between places are part of the response.

For an example response, see maps#show.


maps#allplaces

GET /public/maps/:id/allplaces

The maps#allplaces endpoint returns JSON data for a published map with all the published places on any published with their associated data, specified by slug or id (or 403 if there is no match)

In difference to the show action, allplaces returns all places of a map in an array, which is not organized by layer.

For an example response, see maps#allplaces.


layers#show

GET /public/maps/:map_id/layers/:id

Similar to the previously described, the layers#show endpoint returns all published places with their associated objects for a published layer, specified by slug or numeric id (or 403 if there is no match for the layer's id or slug).

For an example response, see layers#show.

layers#show is also available as geojson and zip format.


places#show

GET /public/maps/:map_id/layers/:layer_id/places/:id

The places#show endpoint returns the data for one specified place (without any associated objects). The places can be retrieved by numeric id only, and a 403 is returned if no published place exists for that ID. For an example response, see places#show.


tags#index

GET /public/maps/:map_id/tags

The tags#index endpoint returns an alphabetically sorted array of tag objects for a specified map, including the count of the tagged objects (taggings). It additionally accepts an optional param for the numeric or slugged layer id: ( i.e. ?layer_id=26 or ?layer_id=parks-in-ottensen), in case only tags for a specific layer shall be returned.

If no published map exists for the required id or slug, a 403 forbidden is returned.

For an example response, see tags#index.


Filtering by tags

The above described endpoints maps#show, maps#allplaces and layers#show allow filtering of the returned places by tags. For each of them, an additional param filter_by_tags=tagA,tagB can be passed which than returns only the places that are tagged with one of the passed tags (case sensitive).

By passing the param &match_all=true, only places are returned that match all of the requested tags.

The response structure remains the same for filtered results, for example responses see maps#show, layers#show and maps#allplaces.