Get all Areas
With this endpoint you can get information about all areas from your Atlas account.
URL¶
POST https://api.geposit.se/1.1/list/areas
Mandatory header parameters¶
x-api-key
(String) This is your API-key and should be included in the header.
Optional POST parameters¶
-
limit
(Integer) The limit of the number of areas that should be included in the response. -
offset
(Integer) The offset value of the response. This together with thelimit
can be used for pagination of the response. -
Tag filtering
(Integer) The tag id can be used to filter for specific values.
/list/areas?tag_id=84925
/list/areas?tag_id[0]=84925
Attribute filtering/conditioning
(String) The following operands can be used to filter for specific values.
Operand | Description | Description |
---|---|---|
eq | is equal to | Exact match to a value |
ct | contains | Contains the value |
nc | doesn't contain | Does not contain the value |
in | is in one or more | Does contain exact match to numeric value |
ni | is not in one or more | Does not contain exact match to numeric value |
ne | is not equal to | Does not match exact value |
be | value BETWEEN low AND high | For time: time[be][]=10:00&time[be][]=12:00 For numeric value: value[be][]=100&value[be][]=1000 For date: date[be][]=2019-01-01&date[be][]=2019-10-10 |
lt | is less than | Numeric value is less than specified one |
gt | is greater than | Numeric value is greater than specified one |
Operands are dependant on the type of custom_field you use in Atlas.
Example: Get all areas with custom_field reg_date
with values greater than 2017-01-28 AND members
equals 1 (one)
/list/areas?reg_date[gt]=2017-01-28&member[eq]=1
Example Request¶
curl -X POST -H "X-api-key: {API_KEY}" https://api.geposit.se/1.1/list/areas -d "limit=2&offset=2"
client()->post("list/areas", [
"query" => [
"limit" => 2,
"offset" => 2
],
"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¶
{
"status": 1,
"areas": [
{
"area_id": 3,
"name": "The First Area",
"my_own_attribute1":"my_own_attribute_value",
"my_own_attribute2":"my_own_attribute_value"
},
{
"area_id": 4,
"name": "The Second Area",
"my_own_attribute1":"my_own_attribute_value",
"my_own_attribute2":"my_own_attribute_value"
}
]
}
-
areas
(Array) Array with zero or more area object(s) matching the query in the request -
area_id
(Integer) The unique identifier of the area. -
name
(String) The name of the Area.
Invalid response¶
Invalid use of supported parameters
{
"status": 0,
"error": "Invalid limit parameter"
}
{
"status": 0,
"error": "Invalid offset parameter"
}
{
"status": 0,
"error": "Generic error"
}