nasnew, do you use remote api or javascript api?
remote api
You can get all geofences from all resources using such request:
https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"avl_resource","propName":"zones_library","propType":"propitemname","propValueMask":"!","sortType":"sys_name"},"force":1,"flags":0x00001001,"from":0,"to":0}&sid=sid
If you need to get geofences only under certain resources you can use such request:
https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"avl_resource","propName":"zones_library,sys_id","propType":"propitemname","propValueMask":"!,your_res1_id,your_res2_id","sortType":"sys_name"},"force":1,"flags":0x00001001,"from":0,"to":0}&sid=sid
You can get all geofence groups including their geofences ids for certain resource using such request:
https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"avl_resource","propName":"zone_groups,sys_id","propType":"propitemname","propValueMask":"!,your_res_id","sortType":"sys_name"},"force":1,"flags":0x00100001,"from":0,"to":0}&sid=sid
To create/update geofence group and add geofences to it you can use such request:
https://hst-api.wialon.com/wialon/ajax.html?svc=resource/update_zones_group¶ms={"itemId":<your_res_id>, "id":<id_of_group_if_exists>,
"callMode":<create/update>,
"n":GROUP_NAME,
"d":DESCRIPTION,
"zns":[<zone_id1,zone_id2,zone_id3>],
"f":0}&sid=sid
More details and examples here:
http://sdk.wialon.com/wiki/en/sidebar/r … arch_items
http://sdk.wialon.com/wiki/en/sidebar/r … les/search
http://sdk.wialon.com/wiki/en/sidebar/r … t/resource
http://sdk.wialon.com/wiki/en/sidebar/r … ones_group
Also you can find useful examples and try your code on our playground http://sdk.wialon.com/playground/
Head of Wialon Local Department
Gurtam