Get Area Postalcodes
With this endpoint you can retrieve all postalcodes for one area.
URL¶
POST https://api.geposit.se/1.1/list/postalcodes/in/area/{areaId}
Mandatory URL parameters¶
areaId
(String) The identifier of the area that you want to get postalcodes for. 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.
Example Request¶
curl -X POST -H "X-api-key: {API_KEY}" https://api.geposit.se/1.1/list/postalcodes/in/area/2370
client()->post("list/postalcodes/in/area/2370", [
"query" => [
],
"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
- Request had bad parameter input / generic error.status = 1
- Request was successful
Valid response¶
Postalcodes¶
-
postalcodes
(Array) Array that contains the postalcodes (if any). -
country_code
(String) The country code of the geography. The following country codes are supported:se
(Sweden)no
(Norway)dk
(Denmark)fi
(Finland)
-
postalcode
(String) The postalcode number. -
locality
(String) The locality to which the postalcode belongs. -
geography_status
(String) Denotes if the geography (the postalcode) has been modified in any way in the context of the given area.
{
"status": 1,
"postalcodes": [
{
"country_code": "se",
"postalcode": "18263",
"locality": "Djursholm",
"geography_status": "1"
},
{
"country_code": "se",
"postalcode": "18129",
"locality": "Lidingö",
"geography_status": "1"
},
{
"country_code": "se",
"postalcode": "18130",
"locality": "Lidingö",
"geography_status": "1"
}
]
}
Invalid response¶
{
"status": 0,
"error": "Invalid limit parameter"
}