Integration

The Logistics Services v1.6 are designed to automate the import processes provided in the Logistics application. It allows you to import order lists and complete routes from CSV or XLSX files or using the JSON format.

Besides, the service allows you to integrate the Logistics application with third-party services and ERP systems by means of API for importing orders or routes.

The server for requests is https://logistics.wialon.com.

Importing orders

Endpoint

Copied!
/api/import

Description

The service allows you to import orders from files or structured data using the POST method. The following input formats are supported:

  • CSV
  • XLSX
  • JSON

The server responds with a JSON object.

General parameters

Parameter Description
authHash OR
token
Authorization hash or token. Token should have permissions on “Modification of important data”.
resourceId ID of the resource where the orders should be saved. The user must have permission to create orders in this resource.
repeated 1 - import orders as permanent (by default, 0).

Parameter for importing from JSON

Parameter Description
data JSON orders array

Request example for cURL

Copied!
curl -X POST "https://logistics.wialon.com/api/import" --data 'token=TOKEN&resourceId=RESOURCE_ID&data=[{"uid":0,"id":0,"n":"test import","p":{"n":"","p":"","p2":"","e":"","a":"Ozo g., 12A, 08200 Vilnius, Lithuania","v":0,"w":0,"c":0,"d":"","ut":600,"t":"","r":null,"cid":"","uic":"","ntf":0,"pr":0,"tags":["test_import"]},"f":32,"tf": 0,"tt":86340,"r":100,"y":54.715678486583435,"x":25.278290202742635,"u":0,"s":0,"trt":3600,"cf":{"cf1":"value_1","cf2":"value2"},"itemId":RESOURCE_ID,"callMode":"create"}]&repeated=1'

Request example for PowerShell

Copied!
Invoke-RestMethod-Uri "https://logistics.wialon.com/api/import" -Method Post -Body "token=TOKEN&resourceId=RESOURCE_ID&data=[`{`"uid`":0,`"id`":0,`"n`":`"test import`",`"p`":`{`"n`":`"`, `"p`":`"`, `"p2`":`"`, `"e`":`"`, `"a`":`"Ozo g., 12A, 08200 Vilnius, Lithuania`",`"v`":0,`"w`":0,`"c`":0,`"d`":`"`, `"ut`":600,`"t`":`"`, `"r`":null,`"cid`":`"`, `"uic`":`"`, `"ntf`":0,`"pr`":0,`"tags`":[`"test_import`"]`},`"f`":32,`"tf`":0,`"tt`":86340,`"r`":100,`"y`":54.715678486583435,`"x`":25.278290202742635,`"u`":0,`"s`":0,`"trt`":3600,`"cf`":`{`"cf1`":`"value_1`",`"cf2`":`"value2`"`},`"itemId`":RESOURCE_ID,`"callMode`":`"create`"}]&repeated=1" -ContentType"application/x-www-form-urlencoded"

Parameters for importing from files

Parameter Default value Description
file CSV file (ZIP archiving allowed).
XLSX file (no ZIP archiving allowed).
columns tf,tt,x,y,p.n,p.a,n,p.r.vt Succession of columns in file should be given in string, comma-separated, no spaces.
separator ; Separator employed in a file.
format %d.%m.%Y %H:%M Time format employed in a file.

Request example for cURL

Copied!
curl https://logistics.wialon.com/api/import -i --form "token=TOKEN" --form "resourceId=RESOURSEID" -- form "format=%d.%m.%Y %H:%M:%S" --form "separator=," --form "columns=n,tf,tt,x,y,p.tags,p.a,p.e,cf.name1,cf.name2" --form "repeated=1" --form "file=@file.csv"

Request example for PowerShell

Copied!
Invoke-WebRequest -Uri 'https://logistics.wialon.com/api/import' -Method POST -Headers @{ 'Content-Type' = 'multipart/form-data' } -Form @{ 'token' = 'TOKEN'; 'resourceId' = 'RESOURSEID'; 'format' = '%d.%m.%Y %H:%M:%S'; 'separator' = ','; 'columns' = 'n,tf,tt,x,y,p.tags,p.a,p.e,cf.name1,cf.name2'; 'repeated' = '1'; 'file' = Get-Item 'file.csv' }

Response in case of success

Object Description
{“parse”: {“ok”: 5, “error”: 0}, “detail”:
{“errors_count”: 0, “msgs”: [],“errors_at”: []}, “save”: {“ok”: 5, “error”: 0}}
Number of orders successfully parsed and saved.

Response in case of error

Object Description
If any errors occur in Wialon, the service returns a standard error. If the error is negative, it means it happened on the side of the service. The field Detail provides more information about the error.

Importing routes

Endpoint

Copied!
/api/route

Description

The service allows you to import routes from files or structured data using the POST method. The following input formats are supported:

  • CSV
  • XLSX
  • JSON

The server responds with a JSON object.

General parameters

Parameter Description
authHash OR
token
Authorization hash or token. Token should have permissions on “Modification of important data”.
resourceId ID of a resource where the orders should be saved. The user must have permission to create orders in this resource.
unitId ID of a unit to which a route is assigned.

Parameter for importing from JSON

Parameter Description
data JSON orders array

Parameters for importing from files

Parameter Default value Description
file CSV file (ZIP archiving allowed). XLSX file (no ZIP archiving allowed).
columns tf,tt,x,y,p.n,p.a,n,p.r.vt Succession of columns in file should be given in string, comma-separated, no spaces.
separator ; Separator employed in a file.
format %d.%m.%Y %H:%M Time format employed in a file.

Request example for cURL

Copied!
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'data=[{"tf":1734433200,"tt":1734451200,"x":25.278290202742635,"y":54.715678486583435,"p":{"n":"Customer","a":"Ozo g., 12A, 08200 Vilnius, Lithuania","r":{"vt":1734451100}},"n":"Order name"}]&resourceId=&token=&unitId=' "https://logistics.wialon.com/api/route"

Request example for PowerShell

Copied!
(Invoke-WebRequest -Uri "https://logistics.wialon.com/api/route" -Method POST -Headers @{ 'Content-Type' = 'application/x-www-form-urlencoded' } -Body 'data=[{"tf":1734433200,"tt":1734451200,"x":25.278290202742635,"y":54.715678486583435,"p":{"n":"Customer","a":"Ozo g., 12A, 08200 Vilnius, Lithuania","r":{"vt":1734451100}},"n":"Order name"}]&resourceId=&token=&unitId=').Content

Response in case of success

Object Description
Information on errors; information on a route created.

Response in case of error

Object Description
If any errors occur in Wialon, the service returns a standard error. If the error is negative, it means it happened on the side of the service. The field Detail provides more information about the error.

Receiving created routes

Endpoint

Copied!
/api/routes

Description

The service supports receiving of built routes using POST method. The server responds with a JSON object.

General parameters

Parameter Description
resourceId ID of the resource a route belongs to.
authHash OR
token
Authorization hash or token.
unitIds Filtering of routes by unit IDs (separate IDs with comma, for example: unitIds=1,2,3). Only routes that are performed by the specified units are included in the response.
from Filtering of routes by time interval. The response contains the routes matching the indicated values. Either parameter can be omitted.
to Filtering of routes by time interval. The response contains the routes matching the indicated values. Either parameter can be omitted.

Request example for cURL

Copied!
curl -X GET 'https://logistics.wialon.com/api/routes?resourceId=<RESOURCE_ID>&token=<TOKEN>'

Request example for Powershell

Copied!
(Invoke-WebRequest 'https://logistics.wialon.com/api/routes?resourceId=25817141&token=0b4ef408f267aed033422a9467202d47AE8D1F4CC508F4B58D60A569999E4678F74E537F' -Method GET).Content

Variables and their values

General parameters

Variable Value
n order name
x longitude
y latitude
r radius, in meters
tf delivery interval starting time
tt delivery interval ending time
trt schedule advancing time, in seconds
p.n client name
p.p phone number
p.p2 second phone number
p.e e-mail
p.a address
p.v volume
p.c cost
p.w weight, in kg
p.ut unloading time, in seconds
P.t vehicle type
p.d comments
p.tags order tags, separator ‘|’
p.ntf notification flags (0x1 - sms on the 1st phone number, 0x2 - sms on the 2d phone number, 0x10 - e-mail)
cf custom field

Routes parameters

Variable Value
p.r.vt delivery point’s planned visiting time
p.r.m planned mileage from a previous delivery point (meters, 0 for the 1st point)
p.r.t planned time from a previous delivery point (seconds, 0 for the 1st point)
rp planned track (if unknown; points processed in a line by the algorithm)

You can find the order format description here.

If you find a mistake in the text, please select it and press Ctrl+Enter.

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form