import_zones_save

To import geofences, use the exchange/import_zones_save command:

Copied!
svc=exchange/import_zones_save&params={"itemId":<long>,
				       "zones":[{
						"n":<text>,
						"d":<text>,
						"id":<long>,
						"t":<byte>,
						"w":<uint>,
						"f":<uint>,
						"c":<uint>,
						"b":{
							"min_x":<double>,
							"min_y":<double>,
							"max_x":<double>,
							"max_y":<double>,
							"cen_x":<double>,
							"cen_y":<double>
						},
						"p":[{
							"x":<double>,
							"y":<double>,
							"r":<uint>
						}]
					}]}

This request can’t be executed simultaneously with any request from this chapter and the following requests:

Parameters

Name

Description

itemId

Resource ID in the system.

id

Geofence ID in the system.

zones

Array of geofence IDs.

You can find the description of other parameters on the get_zone_data page.

In geofence description the following parameters are required: n (geofence name), t (geofence type), w (line thickness or circle radius), f (flags), c (color), p (geofence points). The other geofence parameters are useful, but optional. The itemId parameter (resource ID) is required.

Response

If the request is completed successfully, the number of imported geofences is returned:

Copied!
<int>	

If the request is not completed, an error code is returned.

Error codes

CodeDescription
1Invalid or obsolete request SID.
4Parameter validation error.
6No geofence IDs specified.
7

One of the following errors:

  • resource with the specified ID doesn't exist,
  • failed to fetch the resource with the specified access right (ADF_ACL_AVL_RES_EDIT_ZONES),
  • failed to fetch user.
Download PDF file
Download Word document

See also