To Create Order
https://sdk.wialon.com/wiki/en/kit/remo … der/update
svc=”order/update”;
params={
"uid": 0,
"id": 0,
"n": "DM123456", // Order id
"p": {
"n": "Company Name",
"p": "+971234567888",
"p2": "+971234567889",
"e": "joe@abcdefg",
"a": "Dubai, UAE",
"v": 8700, // Volume
"w": 0, //Weight
"c": 0, //Cost
"d": "factory",
"ut": 600,
"t": "",
"r": null,
"cid": "",
"uic": "",
"ntf": 19,
"pr": 0,
"tags": []
},
"f": 1,
"tf": 1508184000,
"tt": 1508270340,
"r": 100,
"y": 33.8680000305,
"x": 35.5265808105,
"u": 0,
"trt": 3600,
"itemId": 15752853,
"callMode": "create"
}
Response
[
7,
{
"id": 7,
"n": "DM123456",
"f": 1,
"tf": 1508184000,
"tt": 1508270340,
"trt": 3600,
"uid": 86,
"r": 100,
"y": 33.8680000305,
"x": 35.5265808105,
"u": 0,
"s": 0,
"sf": 0,
"st": 0,
"cnm": 0,
"p": {
"a": "Dubai, UAE",
"c": 0,
"cid": "",
"d": "factory",
"e": "joe@abcdefg",
"n": "Company Name",
"ntf": 19,
"p": "+971234567888",
"p2": "+971234567889",
"pr": 0,
"r": null,
"t": "",
"tags": [],
"uic": "",
"ut": 600,
"v": 8700,
"w": 0
},
"ej": {},
"dp": null,
"tz": 134232128,
"rp": ""
}
]
To Optimize Orders
https://sdk.wialon.com/wiki/en/kit/remo … r/optimize
Example:
svc="order/optimize";
params={"itemId":1224646,"orders":[23,24],"units":[16067629],"warehouses":[],"flags":483,"gis":{"addPoints":1,"provider":1,"speed":0,"cityJams":1,"countryJams":1}};
The response:
{
"16067629": {
"orders": [
{
"ml": 0,
"tm": 1508305345,
"id": 0,
"p": ""
},
{
"ml": 26358,
"tm": 1508306718,
"id": 1,
"p": "}_jxCou_qI\k@??TQJM??TLPJ^t@Xp@`@dA??DJRl@??FXJN?T@DNH??^U??`Ao@NM??h@o@??n@s@pAkBrAgCr@}B??^uA??NcAFiAEcAGu@Sy@_@s@Wi@??K[@c@HUpAiB^Y^M??P?TA??ROTSH[??@W?UIS??Ho@jEiG??\g@??`@g@PY??`AcA`@c@VOVIZ???LBL?JC??LAJILMFK??@KDM?K??F]LUl@c@n@_@jCuA??rBsA??f@]bA_A\O^Kb@???R@LA??n@XjNpS??zJ~N??xA|B??bD|E??zAfCxAhC|BfF~@nDNbEIzGYlEO|@e@dB_AfBeCnC}DrD??}CrC??mElD??qT~P??}z@dr@oQbN??koApcAsEhD??}T~O??yT~O??cCxAkBlAcCrAwAj@gDxAqBhA??o@f@c@VSNAR?RN^??z@xA??rD`H??INGN???XNX??NNR@R???z@jE??`BbI??~DlS??a@TSh@??Hr@`@^??^P??ZVd@h@??|DvL??xF~O??hCfH??zEbNbAzCjArB`CrBhBxApAbB??PT`A|Bn@lCNhCx@f}@??N|T??lAvjA??cm@tO??aObE??aB^??IB"
}
]
},
"success": 0
}
If you wish to decode the encoded route you may use the following utility
https://sdk.wialon.com/api/#wialon.util … hod_public
For example:
wialon.util.Gis.decodePoly("}_jxCou_qI\k@??TQJM??TLPJ^t@Xp@`@dA??DJRl@??FXJN?T@DNH??^U??`Ao@NM??h@o@??n@s@pAkBrAgCr@}B??^uA??NcAFiAEcAGu@Sy@_@s@Wi@??K[@c@HUpAiB^Y^M??P?TA??ROTSH[??@W?UIS??Ho@jEiG??\g@??`@g@PY??`AcA`@c@VOVIZ???LBL?JC??LAJILMFK??@KDM?K??F]LUl@c@n@_@jCuA??rBsA??f@]bA_A\O^Kb@???R@LA??n@XjNpS??zJ~N??xA|B??bD|E??zAfCxAhC|BfF~@nDNbEIzGYlEO|@e@dB_AfBeCnC}DrD??}CrC??mElD??qT~P??}z@dr@oQbN??koApcAsEhD??}T~O??yT~O??cCxAkBlAcCrAwAj@gDxAqBhA??o@f@c@VSNAR?RN^??z@xA??rD`H??INGN???XNX??NNR@R???z@jE??`BbI??~DlS??a@TSh@??Hr@`@^??^P??ZVd@h@??|DvL??xF~O??hCfH??zEbNbAzCjArB`CrBhBxApAbB??PT`A|Bn@lCNhCx@f}@??N|T??lAvjA??cm@tO??aObE??aB^??IB")
To Save the Route
https://sdk.wialon.com/wiki/en/kit/remo … ute_update
svc= “order/route_update ”;
Params= {
"itemId": 1224646,
"orders": [
{
"uid": 201,
"id": 23,
"n": "A1",
"p": {
"n": "",
"p": "",
"p2": "",
"e": "",
"a": "Dubai, UAE",
"v": 11,
"w": 10,
"c": 0,
"ut": 60,
"t": "",
"d": "",
"uic": "",
"cid": "",
"r": {
"vt": 1508305345,
"ndt": 1200,
"id": 1508306131054,
"i": 0,
"m": 0,
"t": 0
},
"aff": "",
"z": "",
"ntf": 0,
"cm": "",
"pr": 0,
"tags": []
},
"f": 1,
"tf": 1508270400,
"tt": 1508356740,
"r": 100,
"y": 25.1041641235,
"x": 55.2781028748,
"u": 16067629,
"s": 0,
"sf": 0,
"trt": 600,
"st": 0,
"cnm": 0,
"rp": "",
"ej": {},
"callMode": "update"
},
{
"uid": 202,
"id": 24,
"n": "A2",
"p": {
"n": "",
"p": "",
"p2": "",
"e": "",
"a": "Dubai, UAE",
"v": 11,
"w": 10,
"c": 0,
"ut": 60,
"t": "",
"d": "",
"uic": "",
"cid": "",
"r": {
"vt": 1508306718,
"ndt": 1200,
"id": 1508306131054,
"i": 1,
"m": 26358,
"t": 1373
},
"aff": "",
"z": "",
"ntf": 0,
"cm": "",
"pr": 0,
"tags": []
},
"f": 1,
"tf": 1508270400,
"tt": 1508356740,
"r": 100,
"y": 25.0326385498,
"x": 55.1860923767,
"u": 16067629,
"s": 0,
"sf": 0,
"trt": 600,
"st": 0,
"cnm": 0,
"rp": "}_jxCou_qI\k@??TQJM??TLPJ^t@Xp@`@dA??DJRl@??FXJN?T@DNH??^U??`Ao@NM??h@o@??n@s@pAkBrAgCr@}B??^uA??NcAFiAEcAGu@Sy@_@s@Wi@??K[@c@HUpAiB^Y^M??P?TA??ROTSH[??@W?UIS??Ho@jEiG??\g@??`@g@PY??`AcA`@c@VOVIZ???LBL?JC??LAJILMFK??@KDM?K??F]LUl@c@n@_@jCuA??rBsA??f@]bA_A\O^Kb@???R@LA??n@XjNpS??zJ~N??xA|B??bD|E??zAfCxAhC|BfF~@nDNbEIzGYlEO|@e@dB_AfBeCnC}DrD??}CrC??mElD??qT~P??}z@dr@oQbN??koApcAsEhD??}T~O??yT~O??cCxAkBlAcCrAwAj@gDxAqBhA??o@f@c@VSNAR?RN^??z@xA??rD`H??INGN???XNX??NNR@R???z@jE??`BbI??~DlS??a@TSh@??Hr@`@^??^P??ZVd@h@??|DvL??xF~O??hCfH??zEbNbAzCjArB`CrBhBxApAbB??PT`A|Bn@lCNhCx@f}@??N|T??lAvjA??cm@tO??aObE??aB^??IB",
"ej": {},
"callMode": "update"
}
],
"routeId": 1508306131054,
"callMode": "create"
}
Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam
"Computer science is no more about computers than astronomy is about telescopes."