1

Trying to create a new route (order/route_update)

Тема: Trying to create a new route (order/route_update)

Hi, i'm trying to create a new route in gurtam with the request  order/route_update in the following link of the gurtam api docs https://sdk.wialon.com/wiki/en/sidebar/ … ute_update which has the next parameters

svc=order/route_update&params={ "itemId":<long>,
                "orders":\[\],
                "routeId":<long>,
                "callMode":<text>}

i Send the parameters with PHP like this

$paramsRoute = '{"itemId":15884440,
                "orders":[6,12],
                "routeId":0,
                "callMode":"create"}';   

$arregloRoutes = $wialon_api->order_route_update($paramsRoute."&sid=".$sid."");

where orders means the orders asignet to a specific unit, what i want to do is create a route with those orders in the array of the params orders in the request but in the response of the server i get the error: {"error":3}  which means     Invalid result

Any ideas of what i'm Doing wrong to get that error in the response ??

the final goal is to create a route whit many orders asigned to a unit in logistics.

Hope you can help me guys, Thanks !

2

Trying to create a new route (order/route_update)

Re: Trying to create a new route (order/route_update)

andresapodaca38, this error was already fixed and now in this case you'll get error 4 because you pass "orders" parameter in wrong format. You should pass array of orders' JSONS with call mode parameter. https://sdk.wialon.com/wiki/en/sidebar/ … ute_update
For example:

"orders":[{"uid":3804,"id":93,"n":"5","p":{"n":"","p":"","p2":"","e":"","a":"Calle Rosita, Santa Cruz de la Sierra,","v":0,"w":0,"c":0,"ut":60,"t":"","d":"","uic":"","cid":"","r":{"vt":1518106081,"ndt":900,"id":555,"i":0,"m":0,"t":0},"aff":"","z":"","ntf":0,"cm":"","pr":0,"tags":[]},"f":1,"tf":1518037200,"tt":1518123540,"r":9,"y":-17.8212623596,"x":-63.1322479248,"u":15542315,"s":0,"sf":0,"trt":3600,"st":0,"cnm":0,"rp":"","ej":{},"callMode":"update"},{"uid":3803,"id":92,"n":"4","p":{"n":"","p":"","p2":"","e":"","a":"Unnamed Road, Santa Cruz de la Sierra,","v":0,"w":0,"c":0,"ut":60,"t":"","d":"","uic":"","cid":"","r":{"vt":1518106645,"ndt":900,"id":555,"i":1,"m":2220,"t":564},"aff":"","z":"","ntf":0,"cm":"","pr":0,"tags":[]},"f":1,"tf":1518037200,"tt":1518123540,"r":9,"y":-17.8225688934,"x":-63.1171417236,"u":15542315,"s":0,"sf":0,"trt":3600,"st":0,"cnm":0,"rp":"tuwkBpoi`KkAkCm@wApB_ABCrBy@BApB}@@ApBcArCwABAcBeECEiCmGAE[w@yCkHEKOa@n@Y|B}@lB_ABCpBaABAsBuFg@cAsAmDw@wBAEtBiArB{@@AxBcA@@wAmDcAmC?AeBgE","ej":{},"callMode":"update"}]
Head of Wialon Local Department
Gurtam