Zones

Get All Zone Segments in a Location

Enables you to get information about all zone segments in the specified sublocation. Support requests: GET & POST;

GET SERVER_URL/zone_segment/getAll?userHash={userHash}&sublocationId={sublocationId}

Request Parameters

Empty request returns information about all zones.

Parameter Value
{userHash} hash of the registered user
{sublocationId} ID of the specific sublocation, for which you want to get information

JSON Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
   "zone":{
      "zoneId":2659,
      "id":2659,
      "title":"zone1",
      "map_id":1458,
      "beacons":{},
      "w":"27.00000",
      "h":"27.00000",
      "lat":"55.752121000000",
      "lon":"37.617664000000",
      "hor":"0.00000",
      "pw":"500.00000",
      "ph":"500.00000"
   },
   "zoneSegments":[
      {
         "id":24046,
         "userId":2036,
         "objectType":13,
         "name":"Zone_segment",
         "color":"#cc4ad4",
         "coordinates":[
            {
               "id":21332,
               "kx":"0.32718579",
               "ky":"0.66530055",
               "name":"#cc4ad4",
               "zone_id":2659,
               "x":163.592895,
               "y":332.650275,
               "w":"500.00000",
               "h":"500.00000",
               "is_elevation":null,
               "zone_segment_id":24046,
               "versionId":null,
               "edge_id":null,
               "direction":null
            },
            {
               "id":21333,
               "kx":"0.38592896",
               "ky":"0.75409836",
               "name":"#cc4ad4",
               "zone_id":2659,
               "x":192.96448,
               "y":377.04918,
               "w":"500.00000",
               "h":"500.00000",
               "is_elevation":null,
               "zone_segment_id":24046,
               "versionId":null,
               "edge_id":null,
               "direction":null
            },
            {
               "id":21334,
               "kx":"0.43647541",
               "ky":"0.74590164",
               "name":"#cc4ad4",
               "zone_id":2659,
               "x":218.237705,
               "y":372.95082,
               "w":"500.00000",
               "h":"500.00000",
               "is_elevation":null,
               "zone_segment_id":24046,
               "versionId":null,
               "edge_id":null,
               "direction":null
            },
            {
               "id":21335,
               "kx":"0.40505464",
               "ky":"0.65710383",
               "name":"#cc4ad4",
               "zone_id":2659,
               "x":202.52732,
               "y":328.551915,
               "w":"500.00000",
               "h":"500.00000",
               "is_elevation":null,
               "zone_segment_id":24046,
               "versionId":null,
               "edge_id":null,
               "direction":null
            }
         ]
      }
   ]
}

Creating New Zone

Enables you to create a new zone for the specified sublocation. Support requests: only POST;

POST SERVER_URL/zone_segment/add?userHash={userHash}&sublocationId={sublocationId}

Request Parameters

Parameter Value
{userHash} Hash of the registered user
{sublocationId} ID of the specific sublocation, for which you want to get information

Body form-data parameters

Parameter Value
{userId} Hash of the registered user
{zoneId} ID of the specific sublocation, for which you want to get information
{objectType} 13, which stands for zone
{name} hash-tag separated name and zone color (example: newZone#red)
{coordinates} An array with the zone coordinates
{color} Color of the zone

JSON Body Request Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  "userId": "2796-766F-D3B0-FD66",
  "objectType": "13",
  "zoneId": "3322",
  "name": "Zone_segment",
  "color": "#cc4ad4",
  "coordinates":
    [
        {
          "kx":0.43374317,
          "ky":0.77322404
        },
        {
          "kx":0.39822404,
          "ky":0.70081967
        },
        {
          "kx":0.46106557,
          "ky":0.6352459
        },
        {
          "kx":0.43374317,
          "ky":0.77322404
        }
    ]
}

JSON Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
  "newZone": {
      "id": 861042034,
      "userId": 2319,
      "objectType": 13,
      "name": "Zone_segment",
      "color": "#cc4ad4",
      "zone_segment_type": 2,
      "alias": "F2898A0A-B7C1-11E7-A4AB-5D5C2C687D10",
      "coordinates": [
          {
              "id": 67665,
              "kx": 0.43374317,
              "ky": 0.77322404,
              "name": "#cc4ad4",
              "zone_id": 3322,
              "x": 260.245902,
              "y": 347.950818,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          },
          {
              "id": 67666,
              "kx": 0.39822404,
              "ky": 0.70081967,
              "name": "#cc4ad4",
              "zone_id": 3322,
              "x": 238.934424,
              "y": 315.3688515,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          },
          {
              "id": 67667,
              "kx": 0.46106557,
              "ky": 0.6352459,
              "name": "#cc4ad4",
              "zone_id": 3322,
              "x": 276.639342,
              "y": 285.860655,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          }
      ]
  },
  "types": [
      {
          "id": 1,
          "by_default": 0,
          "name_eng": "Storehouse",
          "name_ru": "Склад",
          "zone_type_color": "#FF9933"
      },
      {
          "id": 2,
          "by_default": 1,
          "name_eng": "Meeting room",
          "name_ru": "Переговорная",
          "zone_type_color": "#339966"
      },
      {
          "id": 3,
          "by_default": 0,
          "name_eng": "Office",
          "name_ru": "Офис",
          "zone_type_color": "#6666FF"
      },
      {
          "id": 4,
          "by_default": 0,
          "name_eng": "Smoking room",
          "name_ru": "Курилка",
          "zone_type_color": "#FF3300"
      }
  ]
}

Editing a Zone Segment

POST SERVER_URL/zone_segment/edit?userHash={userHash}&sublocationId={sublocationId}

Enables you to modify an existing zone by changing it's segment's parameters.

Request Parameters

Parameter Value
{userHash} Hash of the registered user
{sublocationId} ID of the specific sublocation, for which you want to get information

Body form-data parameters

Parameter Value
{id} Zone ID
{name} New Name of the zone segment
{alias} Alias of Zone(GUID format)
{objectType} 13, which stands for zone
{color} hash-tag separated name and zone color
{coordinates} An array with the zone coordinates

JSON Body Request Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
    "id": 881135550,
    "name": "New_name_zone_segment",
    "color": 24047,
    "alias": C423-344C-B94F-32BF,
    "coordinates":
      [
         {
            "coordinates":[
               {
                  "kx":0.0,
                  "ky":0.0,
                  "id":21336,
                  "action":"update"
               },
               {
                  "kx":0.0,
                  "ky":0.0,
                  "id":21337,
                  "action":"update"
               },
               {
                  "kx":0.0,
                  "ky":0.0,
                  "id":21338,
                  "action":"update"
               }
            ]
         }
      ]
}

JSON Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  "modifiedZone": {
      "id": "861042034",
      "userId": 2319,
      "objectType": 13,
      "name": "New_name_of_zone",
      "color": "#ffffff",
      "zone_segment_type": null,
      "alias": "F2898A0A-B7C1-11E7-A4AB-5D5C2C687D10",
      "coordinates": [
          {
              "id": 67665,
              "kx": 0.43374317,
              "ky": 0.77322404,
              "name": "#fffff",
              "zone_id": 3322,
              "x": 260.245902,
              "y": 347.950818,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          },
          {
              "id": 67666,
              "kx": 0.39822404,
              "ky": 0.70081967,
              "name": "#fffff",
              "zone_id": 3322,
              "x": 238.934424,
              "y": 315.3688515,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          },
          {
              "id": 67667,
              "kx": 0.46106557,
              "ky": 0.6352459,
              "name": "#fffff",
              "zone_id": 3322,
              "x": 276.639342,
              "y": 285.860655,
              "w": "600.00000",
              "h": "450.00000",
              "is_elevation": null,
              "zone_segment_id": 34250,
              "versionId": 0,
              "edge_id": null,
              "direction": null
          }
      ]
  }
}

Deleting a Zone Segment

Enables you to remove a zone segment.

POST SERVER_URL/zone_segment/delete?userHash={userHash}&sublocationId={sublocationId}

Request Parameters

Parameter Value
{userHash} Hash of the registered user
{sublocationId} ID of the specific sublocation, for which you want to get information

Body form-data parameters

Parameter Value
{id} ID of the segment that you want to remove

JSON Body Request Example

1
2
3
{
    "id": 861042034,
}

JSON Response

1
2
3
{
  "status": "ok"
}