import_zones_save
To import geofences, use the exchange/import_zones_save command:
svc=exchange/import_zones_save¶ms={"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:
- …/report/exec_report,
- …/report/export_result,
- …/report/get_result_chart,
- …/report/get_result_map,
- …/messages/load_interval,
- …/render/create_messages_layer,
- …/unit/get_trips,
- …/resource/get_driver_bindings,
- …/resource/get_trailer_bindings,
- …/account/get_account_history.
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:
<int>
If the request is not completed, an error code is returned.
Error codes
Code | Description |
1 | Invalid or obsolete request SID. |
4 | Parameter validation error. |
6 | No geofence IDs specified. |
7 | One of the following errors:
|