Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 twinDigital Twin, visit the course page and find out, how to set up an area:

The main information about how to use twinzo´s 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.

Image RemovedImage Added

/areas

  • use for getting requesting 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 / or https://api.twinzo.eu/v3.0/areas/2

/areas

Code Block
languagejson
[
  {
    "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
  }
]
Image RemovedImage Added

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

Code Block
languagejson
{
  "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
}
Image RemovedImage Added

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

a unique 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 the color of the area.

Coordinates

A field of the objects with the [X;Y] coordinates of the points

which

that 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.

Info

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