Get Area Details
With this endpoint you can get details about an area.
URL¶
POST https://api.geposit.se/1.1/get/area/{areaId}
Mandatory URL parameters¶
areaId
(String) The identifier of the area. This value should be part of the URL.
Mandatory header parameters¶
x-api-key
(String) This is your API-key and should be included in the header.
Optional POST parameters¶
with
(String) States if the following information should be included in the response:tags
- Detailed information about the area's tags.style
- Detailed information about the area's style.custom_fields
- Detailed information about the area's custom fields.
Example Request¶
curl -X POST -H "X-api-key: {API_KEY}" https://api.geposit.se/1.1/get/area/2370 -d "with=tags,custom_fields,style"
client()->post("get/area/2370", [
"query" => [
"with" => "tags,style,custom_fields",
],
"headers" => [
"x-api-key" => "your-api-key"
],
]);
Response¶
The response will be in JSON format. Every response comes with a status flag (Integer) where:
status = 0
- Area was not found / The request had bad parameter input / Generic error.status = 1
- Area was found - request was successful
Valid response¶
-
area_id
(Integer) The unique identifier of the area. -
name
(String) The name of the area. -
active
(Integer) Whether the area is active or not. -
date_created
(String) The date and time the area was created in CET. -
date_modified
(String) The date and time when the area was last modified, in CET. -
geographies
(Integer) Number of geographies within the area.
Style¶
-
style
Container for the style parameters. -
color
(String) The color of the area, as a hexadecimal value.
Tags¶
tags
(Array) Array that will contain zero or more members, the tags assigned to the area.
Custom fields¶
custom_fields
(Array) Array that will contain zero or more members, only active if the account has custom fields enabled.
Simple response example:
client()->post("get/area/2370", [
"headers" => [
"x-api-key" => "your-api-key"
],
]);
{
"status": 1,
"area_id": 2370,
"name": "Area Name",
"active": 1,
"date_created": "2018-09-03 11:49:18",
"date_modified": "2018-09-03 11:51:39",
"geographies": 129
}
Example response where the area style, tags and custom fields are included
client()->post("get/area/2370", [
"query" => [
"with" => "tags,style,custom_fields",
],
"headers" => [
"x-api-key" => "your-api-key"
],
]);
{
"status": 1,
"area_id": 2370,
"name": "Area Name",
"active": 1,
"date_created": "2018-09-03 11:49:18",
"date_modified": "2018-09-03 11:51:39",
"geographies": 129,
"style": {
"color": "85144b"
},
"tags": [
"Jazmin",
"Bernardo"
],
"custom_fields": {
"alias-text-area": "my-text-area-value",
"alias-boolean": 1,
"alias-time": "12:42",
"alias-text-input": "my-text-input-value",
"alias-email": "john@doe.com",
"alias-phone": "+46 (0)1 234 56 78",
"alias-date": "2018-12-01"
}
}