1

Logistics Remote API

Тема: Logistics Remote API

Hi GT

We want to integrate Logistics application with a customer third party application. We have 2 questions:

1. We can creat orders via Remote API, but can we distribute them via remote API as well or we have to use Logistics Web Application to distribute one order to nearest vehicle?
2. The customer asked us an customized simple version of Logistics smartphone application and we are going to develop it for them. We want to know more about possibilities to send distributed orders and communications between Driver app and Wialon/Logistics web application. Please lead us how we can do such communications and share documents.

2

Logistics Remote API

Re: Logistics Remote API

Hello

1. to create an order you have to use https://sdk.wialon.com/wiki/en/sidebar/ … er/update, to distribute you need optimize orders with https://sdk.wialon.com/wiki/en/sidebar/ … r/optimize and the last is create a route with the response of optimization with https://sdk.wialon.com/wiki/en/sidebar/ … der/update

other solution for this is the api created by gurtam for integrate with other systems, you can find the documentation on the next link http://apps.wialon.com/files/logistics/ … ces_en.pdf

On my case I created my own api for this beacause Api service logistics did not work as I wanted.

2. I have no idea.

Best Regards and good luck.

3

Logistics Remote API

Re: Logistics Remote API

Gurtam Team

Would you please clarify this case? Thanks in advance.

4

Logistics Remote API

Re: Logistics Remote API

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."
5

Logistics Remote API

Re: Logistics Remote API

kaippally, thanks a lot for you clarification. But:

2. The customer asked us an customized simple version of Logistics smartphone application and we are going to develop it for them. We want to know more about possibilities to send distributed orders and communications between Driver app and Wialon/Logistics web application. Please lead us how we can do such communications and share documents.

Please help us in this case.

6

Logistics Remote API

Re: Logistics Remote API

Any response from GT?

7

Logistics Remote API

Re: Logistics Remote API

Please answer me...

8

Logistics Remote API

Re: Logistics Remote API

2. The customer asked us an customized simple version of Logistics smartphone application and we are going to develop it for them. We want to know more about possibilities to send distributed orders and communications between Driver app and Wialon/Logistics web application. Please lead us how we can do such communications and share documents.

All our applications works through Remote API https://sdk.wialon.com/wiki/en/sidebar/ … ref/apiref so using it you can implement any functionality you see in wialon applications within any custom logic you like

9

Logistics Remote API

Re: Logistics Remote API

Hi guys, i'm trying yo create a route with somo orders that i have created in logistics, first y create the orders Using the command route_update in the callmode create, after y assign the orders to an specific unit, using the comand Assigning unit to order.
svc=order/update&params={"itemId":<long>,   /* resource id */
             "id":<long>,        /* order id (0 if create) */
             "u":<long>,        /* unit id */
             "callMode":"assign"}
like that, until here everything is OK, i create the orders and I assign them to a unit the problem came next

When i try to create a route whit the command  order/route_update:
svc=order/route_update&params={ "itemId":<long>,
                "orders":\[\],
                "routeId":<long>,
                "callMode":<text>}
the response of the server is error 3: invalid result sending the parameters in this way
$paramsRoute = '{"itemId":15884440,
                "orders":[6,12],
                "routeId":0,
                "callMode":"create"}';
i'm almost sure that the problem is in the array "orders", can someone give me an example of this, how can i do correctly the creation of a route with orders ? PLEASE ANY HELP IS WELCOME
Thanks

10

Logistics Remote API

(14/11/2017 11:20:58 отредактировано sets)

Re: Logistics Remote API

Hello, andresapodaca38

You made a mistake in request "order/route_update" https://sdk.wialon.com/wiki/en/sidebar/ … ute_update

routeId can't be 0( routeId => timestamp in milliseconds)
orders - array JSON orders and “callmode” for every each order
For example:

[{"uid":xxx,"id":xxx,"n":"new order 405","p":{"n":"","p":"","p2":"","e":"","a":"Aate, 1, Tallinn, Harjumaa, Estonia","v":0,"w":0,"c":"","ut":600,"t":"","d":"","uic":"","cid":"","r":{"vt":1510645559,"ndt":1200,"id":1510645578954,"i":0,"m":0,"t":0},"aff":"","z":"","ntf":0,"cm":""},"f":1,"tf":1510261200,"tt":1510693140,"r":100,"y":59.379940033,"x":24.7042198181,"u":xxx,"s":0,"sf":0,"trt":3600,"st":0,"cnm":0,"rp":"","ej":{},"callMode":"update"}, .... ]

Kind Regards, Gurtam Team

Команда LABS
11

Logistics Remote API

(16/11/2017 20:18:39 отредактировано andresapodaca38)

Re: Logistics Remote API

HI, sets i fix the wrong parameter error Error 4 but, now i get error 3 invalid results, i created the order, assign  it to a unit and after i try to
create the route with the following array

   "itemId":15884440,
   "orders":[ 
      { 
         "id":35,
         "n":"Culiacan primer entrega",
         "f":2,
         "tf":1510790400,
         "tt":1510876740,
         "trt":300,
         "uid":84,
         "r":12,
         "y":24.8090648651,
         "x":-107.394012451,
         "u":14633478,
         "s":0,
         "sf":0,
         "st":0,
         "cnm":0,
         "p":{ 

         },
         "ej":{ 

         },
         "callMode":"update"
      }
   ],
   "routeId":1510850170671,
   "callMode":"create"
}

but when i send the request i get {"error":3}  which means invalid result, routeId is a timestamp expresed in milliseconds as you said.
i have a question
¿First you jave to create the order and assign it to a unit or you can create it in the same request of creation of the route?
¿Only can be done updating the order?
Any idea of what could be wrong in the request array ?? hope you can help me, maybe if you have the complete array of request in order to compared it with mine could help me a lot , Thanks in advance !

12

Logistics Remote API

Re: Logistics Remote API

andresapodaca38
"First you jave to create the order and assign it to a unit or you can create it in the same request of creation of the route? "

You calling {callMode :update} only if exist the order ( If you created order earlier with id 35 you can update), but if you want create orders in the this request, just write {callMode: 'create'}

Команда LABS