Document toolboxDocument toolbox

Area API

This guide provides information about how to work with areas. The area is an important part of your digital twin because areas simplify output in the 3D app and provide valuable information connected to the area.

Configuration

To connect areas with twinzo digital twin, visit the course page and find out, how to set up an area:

The main information about how to use twinzo´s REST API and how to authorize your access:

Swagger Sector Section

The Swagger Sensors section provides a detailed description of the API for the areas. For getting data we can use /areas or /areas/{id} for specific areas to get information about areas.

/areas

  • use for getting a list of areas from branche

/areas/{id}

  • get specific area’s information according to the id

Example

There are examples for both /areas and /areas/{id} calls below. First is the response you get and then the image with the parameters you have to call for the correct answer. The whole request URL: https://api.twinzo.eu/v3.0/areas / https://api.twinzo.eu/v3.0/areas/2

/areas

[ { "Id": 2, "Guid": "a7a09878-da26-47b9-836f-10042cc02258", "Title": "Server room", "SectorId": 14, "BranchId": 7, "LayerId": 2, "Color": "rgba(23, 235, 27, 1)", "Coordinates": [ { "X": 4249.217, "Y": 1410.62341 }, { "X": 7088.5957, "Y": 1563.25134 }, { "X": 7150.74951, "Y": 6877.926 }, { "X": 4155.986, "Y": 6816.87451 } ], "Created": 1629448926734, "Updated": 1629448942036 }, { "Id": 100, "Guid": "c85f12a8-c765-4bd3-8d04-3ccb01c3a63f", "Title": "Single point", "SectorId": 14, "BranchId": 7, "LayerId": 2, "Color": "rgba(255, 0, 0, 1)", "Coordinates": [ { "X": 15800, "Y": 6800 } ], "Created": 1687964079892, "Updated": 0 } ]

 

/areas/{id} (/areas/2)

{ "Id": 2, "Guid": "a7a09878-da26-47b9-836f-10042cc02258", "Title": "Server room", "SectorId": 14, "BranchId": 7, "LayerId": 2, "Color": "rgba(23, 235, 27, 1)", "Coordinates": [ { "X": 4249.217, "Y": 1410.62341 }, { "X": 7088.5957, "Y": 1563.25134 }, { "X": 7150.74951, "Y": 6877.926 }, { "X": 4155.986, "Y": 6816.87451 } ], "Created": 1629448926734, "Updated": 1629448942036 }

 

Data Properties

The request answer you get is JSON with the single area (one object) or a list of areas (more objects) in the requested branch. Every object contains 10 parameters.

Id

An integer that represents area id.

Guid

A string that represents uniq area´s id.

Title

A string that represents the name of the area.

SectorId

An integer that represents sector id.

BranchId

An integer that represents branch id.

LayerId

An integer that represents layer id.

Color

A string that represents color of the area.

Coordinates

A field of the objects with the [X;Y] coordinates of the points which create an area polygon.

Created

A Unix timestamp in milliseconds that represents the time when the area was created.

Updated

A Unix timestamp in milliseconds that represents the time when the area was last updated.

Area can be represented also by single point. It that case, the coordinates contain only one object.

If you encounter any issues or need assistance with using this product, please do not hesitate to reach out for support. Our team is here to help you resolve any problems and answer any questions you may have.
To create a support ticket, visit our support portal at https://partner.twinzo.eu/helpdesk/customer-care-1