1

Logistics API??

Topic: Logistics API??

Hi, hello it is not possible to have an API for the Logistic application ??
Reagrds

Gabriel

2

Logistics API??

(edited by zark 09/08/2019 09:34:50)

Re: Logistics API??

Hello,

Here it is: sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/order/order

You can find all SDK documentations at the bottom of the following page: docs.wialon.com

@ Oleg Zharkovsky
Technical Consulting / Training Team
"Timely is the best. But still better late than never."
3

Logistics API??

Re: Logistics API??

Hello ,

Does Logistics API support to pick Geo-fence name as address (without having to send y,x geo coordinates ?)

Sint
4

Logistics API??

(edited by sets 12/09/2019 12:40:13)

Re: Logistics API??

Hello, ysv.

If you say about "Logistics Services api" http://apps.wialon.com/files/logistics/ … es_en.pdf, than you can import order by geofence name(property p.a). But don't send parametrs x and y,  because coordinates have hight priority than address name

Fill please <GEOFENCE_NAME>, <TOKEN>, <RES_ID>
Example:

curl -X POST -d 'data=[{"n":"Order address from geofence","p":{"n":"Customer","a":"<GEOFENCE_NAME>","ut":720,"t":"Легковой","r":null,"ntf":0,"pr":0,"tags":["geo_test", "Tag2"]},"tf":1568235600,"tt":1568239999}]&resourceId=<RES_ID>&token=<TOKEN>' 'https://logistics.wialon.com/api/import'

About logistics:
Logistics application have possibility create order by geofences, this implemented by sdk API. How it work into app:
- get list geofences
- find geofence by name (address field)
- get properties (x, y) geofence (step above)
- fill property x, y in order, and p.a(geofence name), these properties x and y need for position on the map and optimization route

Команда LABS
5

Logistics API??

Re: Logistics API??

Hello Sets ,

Thank you

We use order "Update" as described here

https://sdk.wialon.com/wiki/en/sidebar/ … der/update

Will it be possible same method as you described above ? We tried with Geofence name as address and without sending y/x , it returned with an error.

Sint
6

Logistics API??

(edited by sets 12/09/2019 12:58:30)

Re: Logistics API??

ysv wrote:

Hello Sets ,

Thank you

We use order "Update" as described here

https://sdk.wialon.com/wiki/en/sidebar/ … der/update

Will it be possible same method as you described above ? We tried with Geofence name as address and without sending y/x , it returned with an error.

This method don't work, because it is just save order data in database. I suggest use steps when i wrote above "About logistics:"

You got error because properties x and y and etc are required.

Команда LABS
7

Logistics API??

Re: Logistics API??

Thanks for advice .
Will try the method that you have advised to try.

Sint
8

Logistics API??

Re: Logistics API??

Hi Sets ,

thanks for you advice , method you advised above picked up geofence name as address and worked fine.

Sint
9

Logistics API??

Re: Logistics API??

Hi there

We are going to integrate an ERP system with Wialon and Logistics. Regarding Wialon we have enough experience with Remote API but we have
some problems with Logistics API.

1. The scenario is to retrieve Lat, Long, Weight and Volume from orders inside ERP system, create Orders via API call and then distribute them among vehicles. Important case here is that we don't want to assign any order to any Unit (vehicle) and we want the system itself calculate how many vehicles is needed to carry orders and distribute them. Would you please kindly share the steps we have to do step-by step to implement this scenario?

2. Please let us know what is difference between Optimize order execution and  Create, delete route?

3. What is function of Complete orders from history?

If someone from GT explain the whole concept of Logistics API in 4-5 line here it will help me. I know we should create orders and then execute a command to distribute them but History, Route and such words are not clear for me in term of using Logistics API. Also, we expect Logostics API to choose vehicles itself, is it possible? My question here is that if we assign orders to vehicles what exactly the application optimize?

10

Logistics API??

Re: Logistics API??

Hi, hhamedk .
Optimization - creation order points by criterion (by duration, by mileage, ....)
Route - list orders with visit time and others params (tracks)

how create route (step by step)
- create orders
- optimize orders
- create route (https://sdk.wialon.com/wiki/en/sidebar/ … ute_update)

optimization request have params "units". For your scenario you can send all units, system select required number of units by optimization criterions. see documentation(https://sdk.wialon.com/wiki/en/sidebar/ … r/optimize).

I created small example, fill necessary params (javascript)
https://codesandbox.io/s/route-from-fix … c/index.js

if you have any questions please ask

Команда LABS
11

Logistics API??

(edited by hhamedk 15/04/2020 16:29:14)

Re: Logistics API??

sets, thank you for your help.

As I understood Route is using the Wialon Route module, right?
How we should get online delivery status of distributed orders? (I mean after vehicles start their routes)

Also please provide me more information about tt and tf parameters.
Flags 0x20 and 0x40 are clear for me but I can't understand other flags algorithm. Give me some explanation about them also.
Can we sum flags like 0x20 + 0x40 to ask server optimize orders based on Weight and Volume together? (or other flags)

12

Logistics API??

Re: Logistics API??

hi, hhamedk

hhamedk wrote:

sets, thank you for your help.

As I understood Route is using the Wialon Route module, right?
How we should get online delivery status of distributed orders? (I mean after vehicles start their routes)

Also please provide me more information about tt and tf parameters.
Flags 0x20 and 0x40 are clear for me but I can't understand other flags algorithm. Give me some explanation about them also.
Can we sum flags like 0x20 + 0x40 to ask server optimize orders based on Weight and Volume together? (or other flags)


No, Logistics Route don't equal Wialon Route, it is new item.
https://sdk.wialon.com/wiki/en/sidebar/ … ute_update

Params tf and tt = unix time (dilivery time from - to) (https://en.wikipedia.org/wiki/Unix_time)
"Flags 0x20 and 0x40 are clear for me but I can't understand other flags algorithm. Give me some explanation about them also."
Yes of course, you can combine flags just like here https://sdk.wialon.com/wiki/en/sidebar/ … ormat/unit

Команда LABS
13

Logistics API??

(edited by hhamedk 18/04/2020 07:22:10)

Re: Logistics API??

sets, I can't understand the Route, After we optimize order, then why we need to create that? Please explain for me. Give me a example.
May you also tell me about assigning of units to orders? What is reason of that while you say Logistics automatically selects units and optimize them.

14

Logistics API??

(edited by hhamedk 20/04/2020 16:27:34)

Re: Logistics API??

We pass below and receive error 4. Please explain what is wrong. We feel lack of good documentation for Logistics.

http://logistics.example.com/wialon/ajax.html?sid=f2ce66345ba29aefaf482312d3c44eec&svc=order/update&params={"uid":0,"itemId":237,"id":0,"n":GGRCO Test Order","p":{"n":"Some Name","p":"+989121111111","p2":"+989122222222","e":"aa@aa.com","a":"Tehran, Somewhere","v":1,"w":20,"c":100000,"ut":600,"t":"","d":"Some Text","uic":"","cid":"","ntf":3,"pr":0,"tags":[],"r":null},"f":1,"tf":1587447000,"tt":1587454200,"trt":900,"r":50,"y":35.73537357430529,"x":51.386500059131244,"u":0,"ej": {"Prameter A":"a","Parameter B":"b"},"tz":12600,"callMode":"create"}
15

Logistics API??

Re: Logistics API??

hhamedk
i created example, see there  https://codesandbox.io/s/route-from-fixed-orders-42kwm
This example include optimization and route creation, you need put params sid, unit_id(array id), and resource id

Команда LABS
16

Logistics API??

(edited by sets 20/04/2020 17:05:02)

Re: Logistics API??

hhamedk wrote:

We pass below and receive error 4. Please explain what is wrong. We feel lack of good documentation for Logistics.

http://logistics.example.com/wialon/ajax.html?sid=f2ce66345ba29aefaf482312d3c44eec&svc=order/update&params={"uid":0,"itemId":237,"id":0,"n":GGRCO Test Order","p":{"n":"Some Name","p":"+989121111111","p2":"+989122222222","e":"aa@aa.com","a":"Tehran, Somewhere","v":1,"w":20,"c":100000,"ut":600,"t":"","d":"Some Text","uic":"","cid":"","ntf":3,"pr":0,"tags":[],"r":null},"f":1,"tf":1587447000,"tt":1587454200,"trt":900,"r":50,"y":35.73537357430529,"x":51.386500059131244,"u":0,"ej": {"Prameter A":"a","Parameter B":"b"},"tz":12600,"callMode":"create"}

You made mistake (skipped "), your JSON invalid. GGRCO Test Order"
valid JSON:

{"uid":0,"itemId":237,"id":0,"n":"GGRCO Test Order","p":{"n":"Some Name","p":"+989121111111","p2":"+989122222222","e":"aa@aa.com","a":"Tehran, Somewhere","v":1,"w":20,"c":100000,"ut":600,"t":"","d":"Some Text","uic":"","cid":"","ntf":3,"pr":0,"tags":[],"r":null},"f":1,"tf":1587447000,"tt":1587454200,"trt":900,"r":50,"y":35.73537357430529,"x":51.386500059131244,"u":0,"ej": {"Prameter A":"a","Parameter B":"b"},"tz":12600,"callMode":"create"}
Команда LABS
17

Logistics API??

(edited by hhamedk 21/04/2020 13:58:19)

Re: Logistics API??

sets, Thank you for your help.

Would you please explain below parameters with real examples? The documentation description is not enough for us to understand them. also seems that some of these parameters are optional based on callMode but documents doesn't say anything about this case that those are optional. Please inform me which ones are optional:

ORDER CREATE/UPTADE

"oldOrderId":<long>,    /* old oreder id */
"oldOrderFiles":[<text>],     /* old order files array */
"uic":<text>,      /* number of shipping document */
"cid":<text>,      /* custom ID */
"cm":<text>,       /* comment from confirm/reject */
"aff":<text>,      /* [ warehouse ] list of unit ID's of warehouse ("123,456") */
"z":<text>,        /* [ warehouse ] list of geofences of warehouse ("resId_geofenceId,...") */
"tags":[<uint>]    /* order tags */   >>>   Explain its functionality
"rp":<text>,        /* order route */
"dp":"[<uint>,..]" /* array of dependent orders IDs */

I understood the Route, But I can't understand while we are creating a order why we should pass Route

"r": {        /* route infotmation */
                 "id":<text>,        /* route id */
                 "i":<text>,        /* number [0..] */
                 "m":<text>,        /* mileage from previous point according to the plan, m */
                 "t":<text>,        /* time from previous point according to the plan, s */
                 "ndt":<uint>,      /* time to notify customer before assumed delivery time, s */
                 "vt":<text>        /* visit time according to the plan, UNIX_TIME */
},

Regarding flags of order I need explanation for below ones:

0x4     start warehouse;
0x8     final warehouse;
0x10     reload warehouse
0x20     fixed order 

ORDER OPTIMIZATION

"orders":[<uint>,{JSOn},...],   >>>   I understand it, just to be sure, we should pass orders ID we want to optimize separated with comma? Whats the meaning of "orders indexes/orders JSON delimited with comma"?
"warehouses":[<uint>],   >>>   is it optional? what is its function?

Is GIS parameter and its sub-parameters optional while we are using Gurtam map?

I don't understant these at all:

"busyRoutes":{
                   "<uint>":[
                   {
                       "tf":<uint>,
                       "tt":<uint>,
                       "pf":{<uint> || {JSON}},
                       "pt":{<uint> || {JSON}
                   },
"priority":{<uint>:{<uint>:<uint>},...},

while we have set orders priority in creation of that why we should pass priority here?!!!

"preference":{<uint>:<uint>,...}}

Regarding optimization flags please explain each flag in details.

Thank you for your help and detailed explanation in advance.

18

Logistics API??

Re: Logistics API??

hhamedk wrote:

"oldOrderId":<long>,    /* old oreder id */
"oldOrderFiles":[<text>],     /* old order files array */
"uic":<text>,      /* number of shipping document */
"cid":<text>,      /* custom ID */
"cm":<text>,       /* comment from confirm/reject */
"aff":<text>,      /* [ warehouse ] list of unit ID's of warehouse ("123,456") */
"z":<text>,        /* [ warehouse ] list of geofences of warehouse ("resId_geofenceId,...") */
"tags":[<uint>]    /* order tags */   >>>   Explain its functionality
"rp":<text>,        /* order route */
"dp":"[<uint>,..]" /* array of dependent orders IDs */

dp - the system params, don't touch them
rp - planned track (if unknown; points processed in a line by the algorithm
https://developers.google.com/maps/docu … algorithm)
tags - order tags, separator ‘|’ (string)
aff - this param applies only for warehouse (you can see in to app logistics, settings, list warehouses)
z - this param applies only for warehouse (you can see in to app logistics, settings, list warehouses)

uic, cid - unused params

Also see parameters list in the end of document http://apps.wialon.com/files/logistics/ … ces_en.pdf

Команда LABS
19

Logistics API??

Re: Logistics API??

hhamedk wrote:

                 "r": {        /* route infotmation */
                 "id":<text>,        /* route id */
                 "i":<text>,        /* number [0..] */
                 "m":<text>,        /* mileage from previous point according to the plan, m */
                 "t":<text>,        /* time from previous point according to the plan, s */
                 "ndt":<uint>,      /* time to notify customer before assumed delivery time, s */
                 "vt":<text>        /* visit time according to the plan, UNIX_TIME */

The First of all
property p - it is custom JSON, if need you can put your own params for your logic

these params filling after optimization in app "logistics". You can open dev tools in your browser and will see that.
method svc=order/route_update with callMode = 'create' and list of orders (JSON)
i wrote that in "i created example, see there  https://codesandbox.io/s/route-from-fixed-orders-42kwm"

Команда LABS
20

Logistics API??

Re: Logistics API??

sets wrote:

"orders":[<uint>,{JSOn},...],   >>>   I understand it, just to be sure, we should pass orders ID we want to optimize separated with comma? Whats the meaning of "orders indexes/orders JSON delimited with comma"?
"warehouses":[<uint>],   >>>   is it optional? what is its function?

params "orders" can consist from list id of orders and list JSON
For example:

orders: [1,2,3,4]
orders: [{"y":53.902961731,"x":27.4966392517,"tf":1587416401,"n":"1","tt":1587502740,"f":0,"r":100,"p":{"ut":600,"w":0,"v":0}}]

"warehouses" the same as "orders",but you need indicate warehouse flags

0x4     start warehouse;
0x8     final warehouse;
0x10     reload warehouse
Команда LABS
21

Logistics API??

(edited by hhamedk 21/04/2020 18:36:25)

Re: Logistics API??

sets, thank you for your post.

dp - the system params, don't touch them

We won't touch it, but let us understand it. We are going to develop an application based on Logistics API and we have to understand each parameter very well. We should know everything before starting development. (My brain says "If that's really useless why they put it there?!! It should has some function")

rp - planned track (if unknown; points processed in a line by the algorithm

My exact question is that why we should pass it in time of creation of order, nothing else.

aff - this param applies only for warehouse (you can see in to app logistics, settings, list warehouses)
z - this param applies only for warehouse (you can see in to app logistics, settings, list warehouses)

What will we gain when we pass these parameters in time of creation of an order?!

uic, cid - unused params

What the hell! You have some useless parameters and you also reflected them in your documents?! (BTW, if cid is a custom ID we can set for order except the ID of order in Logistics app as I guess, then that's really useful for my case)

Also see parameters list in the end of document http://apps.wialon.com/files/logistics/ … ces_en.pdf

Tell me where in this file I can get more data than what you have shared or provided in SDK docs.

property p - it is custom JSON, if need you can put your own params for your logic

these params filling after optimization in app "logistics". You can open dev tools in your browser and will see that.
method svc=order/route_update with callMode = 'create' and list of orders (JSON)

If you mean property r, As I understood you mean we can pass these parameters to server to tell server consider these limitations while optimizing orders, right?

i wrote that in "i created example, see there  https://codesandbox.io/s/route-from-fixed-orders-42kwm"

Thank you but I don't need your sample code, I need description of parameters. (BTW, I changed your code to work with our WL but doesn't work or I'm not able to use it)

params "orders" can consist from list id of orders and list JSON

If I got you correctly we can NOT to create orders BUT pass these orders via vc=order/optimize command and ask system to optimize them for us, right?

Please someone read my previous post and explain them one by one.

22

Logistics API??

Re: Logistics API??

sets, lets try this way: you address me about each parameter to related field in Logistics App.

23

Logistics API??

Re: Logistics API??

hhamedk
You have tons of questions, but most of them not HOW to use API, but WHY API work like this.

>  I can't understand the Route, After we optimize order, then why we need to create that?
>  I can't understand while we are creating a order why we should pass Route
>  while we have set orders priority in creation of that why we should pass priority here?!!!
> My exact question is that why we should pass it in time of creation of order, nothing else.

The only answer to this WHY questions I can give you - it's because of server architecture. And I don't want to discuss is it good or not. It works. And moreover, Wialon Remote API (you're familiar with it, right?) works in the same way - you have to pass all the parameters in requests (for example, https://sdk.wialon.com/wiki/en/sidebar/ … date_zone) even if you don't understand them.

Same logic works with logistics API. When you want to update any field of order you have to pass all other (even if you already set them during creation). Simply saying - server will rewrite order in DB with all data from request. That is why you have to add all order properties.

Another important question is why route information saved in order. It's just a child-parent pattern. You can create parent and add list of child too it (then parent will know all its children) OR you can create child and save parent info in it (so every child will know its parent). Logistics works in the second way, each order have info about route.

The last thing I want to say - I strongly believe, you can repair car not knowing how it's engine works somewhere inside and you can develop APP for YOUR needs with YOUR business logic not knowing meaning of every parameters.

Please tell us what you're going to develop and we'll tell you HOW it can be done with logistics API. That's we can do)

Thanks!

P.S. I believe the right question is the key to get right answer. Try to ask HOW, not WHY

24

Logistics API??

(edited by hhamedk 22/04/2020 08:41:20)

Re: Logistics API??

shmi, you are in wrong way unfortunately. I have asked TONs of question and because of any reason couldn't get my answer among your/your colleague answers. When I wrote WHY that means I wanted to know the reason and logic of Logistics API. I don't want to change your API or analyze it (to tell if it's good or not), but I want to understand and use it. There are some parameters that I can't understand them.
Pavel Bushuyeu has posted a good topic on https://forum.gurtam.com/viewtopic.php?id=12389 and suggested all members a standard way to describe their issues/suggestions in forum. I guess he can post a topic for his colleagues to suggest them how to reply a partner request in forum!

BTW, What's wrong with my posts? Tons of questions? Shouldn't I ask?

You could just simply answer my TONs of questions one-by-one, like:

"cid":<text>,      /* custom ID */
cid is related to X, and this means you can use it as Y to solve Z problems. Remember that cid is optional.

Waht you think? TONs of questions can be responded with TONs of patient and respect.

25

Logistics API??

Re: Logistics API??

hhamedk I understand that api is complicated.

I will try explain what is params "dp".
This is array of dependent orders IDs which are exist into the route. In system have two mode of route: strict and custom. Each order depends on the previous one for strict mode.This is stored there.

Also at the development stage, various properties were created, but not all of them are now used. I wrote unused, becouse i didn't use in application "logistics". For example: rp - part of the path of the object is stored, but you can save elsewhere. Only in this case you will lose backward compatibility with our application.

"My exact question is that why we should pass it in time of creation of order, nothing else."
You can put during creation of order/route as you wish.

Команда LABS