1

Creation of a new route

Тема: Creation of a new route

hello all , hope every one is okey

what i do is

"using  remote API not javascript "

1 - login and get session  id
2- get list for geofence by item search

try the route add api
but it give me error 4

i don't know at route add step how to get itemid or resource id ?

the zone i will create route for
"5":{"n":"xxx 1","i":5,"t":1,"d":0,"ar":0,"pr": xxxxxx secret ---- ,"dr":{"addr":1,"ride_begin":1,"ride_end":1,"color":1669936},"p":"         ---Secret ----- ","cp":[{"at":0,"atd":300,"dt":0,"dtd":300,"n":"Jadah1"},{"at":0,"atd":300,"dt":0,"dtd":300,"n":"Jadah2"},{"at":0,"atd":0,"dt":0,"dtd":0,"n":"Jadah"}]}

and add route api
ajax.html?svc=resource/update_route&params={%22itemId%22:50936,%22id%22:0,%22callMode%22:create,%22resourceId%22:663,%22zoneId%22:5,%22d%22:%22xx%22,%22n%22:%22xx%22,%22f%22:%220%C3%971%22,%22at%22:%221457938000%22}&sid=XXXX

It give me error 4

2

Creation of a new route

Re: Creation of a new route

you should put value of parameter "f" without quotes. And if you want to use hex value put 0xa1

Development Department
Gurtam
3

Creation of a new route

Re: Creation of a new route

hello thankz zuve for your replay i follow what you told me and know i got error 6 "unkown error"

here is my query
ajax.html?svc=resource/update_route&params=%7B"itemId":792,"id":0,"callMode":create,"resourceId":792,"zoneId":5,"d":"xx","n":"xx","f":0xa1,"at":"1457938000"%7D&sid=HIDDEN

here i got resourceid=itemid from search item for avl_resource and got from car item list the record "i"
and do same for zones to get zone id

what i do wrong here ?

4

Creation of a new route

Re: Creation of a new route

Probably you haven't got service "routes" in your billing plan. Or you are lying and there is no such zone in such resource)))

Development Department
Gurtam
5

Creation of a new route

Re: Creation of a new route

we have all models on our plan ,
how can i get correct zone id ?
this output of itemsearch
"5":{"n":"XXX1","i":5,"t":1,"d":0,"ar":0,"pr":20615.5338868,"dr":{"addr":1,"ride_begin":1,"ride_end":1,"color":1669936},"p":"21.572753,39.214589,50,21.664355,39.224374,50,21.625424,39.316041,0","cp":[{"at":0,"atd":300,"dt":0,"dtd":300,"n":"Jadah1"},{"at":0,"atd":300,"dt":0,"dtd":300,"n":"Jadah2"},{"at":0,"atd":0,"dt":0,"dtd":0,"n":"Jadah"}]}
is it right that zone id is 5 ?

Added after    3 minuts  41 seconds:
ok i got it  , how to get back result of this zone as report , i mean distance etc

6

Creation of a new route

Re: Creation of a new route

Eng Ayman пишет:

how can i get correct zone id ?

svc=core/search_items&params={"spec":{"itemsType":"avl_resource","propName":"sys_name","propValueMask":"*","sortType":"sys_name"},"force":1,"flags":0x4001,"from":0,"to":0xffffffff}

according to your JSON zone id is really 5. But i can't see whether you put correct resource id. I can only say that you have zone with id 5 in some resource.

Eng Ayman пишет:

ok i got it  , how to get back result of this zone as report , i mean distance etc

all info about zone you can get with the help of request that i described higher. If you want to know perimeter and area you should calculate it by yourself.

in request resource/update_route you can get error 6 in cases:
1. routes are not allowed by your billing
2. zones are not allowed by your billing
3. wrong recource id
4. wrong zone id
5. there is no such route (update case)
6. error updating route
7. error deleting route

Development Department
Gurtam
7

Creation of a new route

Re: Creation of a new route

dear zuve ,
thanks for your active support ,
every thing is okey now for creating zone
and for creating route its ok

how can now i get route result (start,end time , distance by api )

8

Creation of a new route

(25/11/2013 19:27:36 отредактировано zuve)

Re: Creation of a new route

Do the core/search_items request with flag 0x10000

Development Department
Gurtam
9

Creation of a new route

Re: Creation of a new route

Hello again and sorry for that  , core search give the route configuration not result report

i tried
svc=report/exec_report&params={"reportResourceId":795,"reportTemplateId":3,"reportObjectId":1007,"reportObjectSecId":0,"interval":{"from":1384802010,"to":1385406877,"flags":0×00}}&sid=XXXXX

it give me again error 4 ? why ?

10

Creation of a new route

Re: Creation of a new route

after change flags to 0 i got
{"error":6}
how to fix

and from where i get reportResourceId ?
is it same resource id of client ?

11

Creation of a new route

Re: Creation of a new route

Eng Ayman пишет:

and from where i get reportResourceId ?
is it same resource id of client ?

It is the id of resource where you keep report template with id 3

what version of Pro do you use? and why  you put sid instead of ssid?

Development Department
Gurtam