Areas

An area is an user-defined enclosed space. Areas can be used for statistics, user tracking and events.
Attributes
id string
Area identifier
created_at datetime
Time when the area was created
updated_at datetime
Time when the area was updated
custom_fields array of objects
List of custom key-value pairs. More details in Custom fields
code string
User-defined area identifier
name string
Area name
organization_id string
Organization identifier
description text
Area description
type string
Area geometry type. Posible values are POINT, LINE, POLYGON and CIRCLE.
geometric array of objects
Area geometry
level_id integer
Area floor in building
building_id string
Area building identifier
deleted boolean
Wether or not the area is deleted
Sample response
    {
        "id": "8a017979-8983-42e1-96a2-4e02688ea6da",
        "created_at": "2019-05-07T11:26:16.840Z[UTC]",
        "updated_at": "2019-05-21T11:45:53.761Z[UTC]",
        "custom_fields": [],
        "code": "222",
        "name": "geofence1",
        "organization_id": "478ee088-96f7-4a5f-a2a4-074c6893c346",
        "description": "<p>222</p>",
        "type": "POLYGON",
        "geometric": [
            [
                40.49459442765684,
                -3.592425885144621
            ],
            [
                40.493827484014716,
                -3.5924580716528
            ],
            [
                40.49415384408281,
                -3.5916426801122725
            ],
            [
                40.49459442765684,
                -3.592425885144621
            ]
        ],
        "level_id": 4272,
        "building_id": "2876",
        "deleted": false
    }

Searches areas with given filters

This method returns a list of areas, given certain filters, of which at least one must be provided.
Parameters
X-API-EMAIL required header param
The email of the user
X-API-KEY required header param
The API key of the user
organization_id optional query param
Organization identifier
building_id optional query param
Building identifier
deleted optional query param
Wether or not to fetch deleted areas
Returns
Returns an array of paginated area objects.
Error Status Codes
Request url
https://dashboard.situm.es/api/v1/areas/search/
Curl
curl -H 'Content-Type: application/json' -H 'X-API-EMAIL: user@example.com' -H 'X-API-KEY: T9NP+jSIOi5DG6ODk57O0pZXdx4T9NP2lzk+jSI/Oi5DG6ODk57O0pZXdx4' 'https://dashboard.situm.es/api/v1/areas/search?building_id=2876&organization_id=7cc5d373-94e7-4270-b778-459bf88928f2'
Response body
{
    "data": [
        {
            "id": "8734e5b7-0c46-4c1a-8706-556737d14c2a",
            "created_at": "2019-05-07T11:26:16.840Z[UTC]",
            "updated_at": "2019-05-21T11:45:53.761Z[UTC]",
            "custom_fields": [],
            "code": "222",
            "name": "geofence1",
            "organization_id": "7cc5d373-94e7-4270-b778-459bf88928f2",
            "description": "<p>222</p>",
            "type": "POLYGON",
            "geometric": [
                [
                    40.49459442765684,
                    -3.592425885144621
                ],
                [
                    40.493827484014716,
                    -3.5924580716528
                ],
                [
                    40.49415384408281,
                    -3.5916426801122725
                ],
                [
                    40.49459442765684,
                    -3.592425885144621
                ]
            ],
            "level_id": 4272,
            "building_id": "2876",
            "deleted": false
        },
        {
            "id": "cbad03c1-2c87-4216-ac32-46f7abd2a26d",
            "created_at": "2019-05-21T09:38:14.510Z[UTC]",
            "updated_at": "2019-05-22T09:13:28.482Z[UTC]",
            "custom_fields": [],
            "code": "geofence2",
            "name": "geofence2",
            "organization_id": "7cc5d373-94e7-4270-b778-459bf88928f2",
            "type": "POLYGON",
            "geometric": [
                [
                    40.491519531406006,
                    -3.594662742059427
                ],
                [
                    40.485709856791615,
                    -3.5947271150757842
                ],
                [
                    40.48577513682813,
                    -3.5883541864563995
                ],
                [
                    40.496513468789644,
                    -3.5886760515381866
                ],
                [
                    40.4963666121202,
                    -3.590864734094339
                ],
                [
                    40.49646451660222,
                    -3.5945983690430694
                ],
                [
                    40.491519531406006,
                    -3.594662742059427
                ]
            ],
            "level_id": 4272,
            "building_id": "2876",
            "deleted": false
        }
    ],
    "metadata": {
        "first": true,
        "last": true,
        "total_pages": 1,
        "total_elements": 2,
        "number_of_elements": 2,
        "size": 0,
        "number": 1
    }
}

Get area

Fetches the information of a single area, given it's identifier.
Parameters
X-API-EMAIL required header param
The email of the user
X-API-KEY required header param
The API key of the user
id required path param
Area identifier
organization_id optional query param
Organization identifier
Returns
Returns an area object
Error Status Codes
Request url
https://dashboard.situm.es/api/v1/areas/:id/
Curl
curl  -H 'Content-Type: application/json' -H 'X-API-EMAIL: user@example.com' -H 'X-API-KEY: T9NP+jSIOi5DG6ODk57O0pZXdx4T9NP2lzk+jSI/Oi5DG6ODk57O0pZXdx4' 'https://acciona-des.situm.es/api/v1/areas/8734e5b7-0c46-4c1a-8706-556737d14c2a'
Response body
{
    "id": "8734e5b7-0c46-4c1a-8706-556737d14c2a",
    "created_at": "2019-05-07T11:26:16.840Z[UTC]",
    "updated_at": "2019-05-21T11:45:53.761Z[UTC]",
    "custom_fields": [],
    "code": "222",
    "name": "geofence1",
    "organization_id": "7cc5dc373-94e7-4270-b778-459bf88928f2",
    "description": "<p>222</p>",
    "type": "POLYGON",
    "geometric": [
        [
            40.49459442765684,
            -3.592425885144621
        ],
        [
            40.493827484014716,
            -3.5924580716528
        ],
        [
            40.49415384408281,
            -3.5916426801122725
        ],
        [
            40.49459442765684,
            -3.592425885144621
        ]
    ],
    "level_id": 4272,
    "building_id": "2876",
    "deleted": false
}