Container ID
A container is what the web app calls an area: a named shape in a group, made up of one or more geographies (postcodes, municipalities, custom polygons). You need the Map ID.
The container ID is shown next to the area's name in the web app when Show Object IDs is on. With the API there are three ways to find it:
- All areas of a map, per group: Layer ID (
GET /v2.0/layer/map/{map_id}/area). - All areas of a map, as one list:
POST /v2.0/container/all, below. - The areas that contain a postcode: see Validate postcode coverage.
curl 'https://app-api.geposit.se/v2.0/container/all?with_geo_names=true' \
--header 'x-api-key: {API_KEY}' \
--header 'content-type: application/json' \
--data '{"map_id": "{map_id}"}'The body can also take layer_id to list one group only, and filter_id or filter to apply a saved filter.
{
"containers": [
{
"id": "CONTAINER_ID",
"map_id": "MAP_ID",
"layer_id": "LAYER_ID",
"name": "Arvidsjaur",
"visible": true,
"geo_ids_ref_groups": [
{
"ref_id": "REF_ID",
"geo_type": "postalcode_5",
"country": "se",
"geo_ids": [
{
"polygon_id": "POLYGON_ID",
"feature_id": "FEATURE_ID",
"geo_name": "93391",
"geo_code": "93391"
}
]
}
],
"custom_polygons": [],
"area_sq.km": 1323.3
}
]
}(Shortened.) id is the container ID. Without with_geo_names=true, geo_name and geo_code are left out.
Updated 13 days ago
Did this page help you?