Topic: How to Create routes between points for units programmatically
How to Create routes between points for units programmatically using API
How to Create routes between points for units programmatically using API
Hello!
you can use requests which creates routes into the Wialon :
first create route via [url=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/core/create_route]svc=core/create_route
[/url]
https://hst-api.wialon.com/wialon/ajax.html?svc=core/create_route&sid=025801bf84ec9ab812f90168d2c9d742¶ms={"creatorId":98,"name":"New route1","dataFlags":3845}
then add required point to this route using svc=route/update_checkpoints
for example
https://hst-api.wialon.com/wialon/ajax.html?svc=route/update_checkpoints¶ms={"itemId":20738013,"checkPoints":[{"f":1,"n":"France","y":48.042817456955056,"x":4.360154705026546,"r":"100"},{"f":1,"n":"Spain","y":40.40534711080524,"x":-3.501772215857237,"r":"100"}]}}],"flags":0}&sid=025801bf84ec9ab812f90168d2c9d742
Also you can look through opensource app
Delivery Service which creates routes.
thank you very much, please I need your help on this also, how can I create predefined execution time jobs and correlate these jobs to my routes ,I know that I can correlate orders to routes but I don't know how to correlate jobs to routes
Create new jobs:
https://sdk.wialon.com/wiki/en/sidebar/ … update_job
create new orders
https://sdk.wialon.com/wiki/en/sidebar/ … ute_update
thank and regards,
thank you very much, please I need your help on this also, how can I create predefined execution time jobs and correlate these jobs to my routes ,I know that I can correlate orders to routes but I don't know how to correlate jobs to routes
Create new jobs:
https://sdk.wialon.com/wiki/en/sidebar/ … update_job
create new orders
https://sdk.wialon.com/wiki/en/sidebar/ … ute_updatethank and regards,
Hello!
there are different request for different functional type: job is used to execute commands, sends report to email and etc , order is order management process used on our app Logistics
If you need to developer some app like Logistics, you should look through orders and assing then to their routes
Hello Please I need your help to find out where to get detailed information about schedule I need to use the below function
https://sdk.wialon.com/wiki/en/sidebar/ … e_schedule
In brief I need to create notifications for Routes/Rounds/Schedules for car units
here is my workflow:
- Create a Route
- Assign Check points to route
- create schedule with Rounds
- Create Notifications
my problem is I cannot find format for schedule parameters please help
thank you for your support
Hello!
The full list of parameters for schedule is here
For example, the response below can create the following schedule as on attached image
https://hst-api.wialon.com/wialon/ajax.html?svc=route/update_schedule&sid=02186bbd5c950e0e55ea09231367e10e¶ms={"n":"10:00-12:00","f":2,"tz":134228528,"u":20685653,"tm":[{"at":36000,"ad":2100,"dt":36000,"dd":2100},{"at":43200,"ad":1800,"dt":43200,"dd":1800}],"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0},"cfg":{"name":"roundName","units":[20685653],"enabled":1,"roundFlags":2,"autoName":0,"validityPeriod":86400},"itemId":20738013,"id":0,"callMode":"create"}
where
{
"n":"10:00 - 12:00", /*schedule name */
"f":2, /*schedule type, 2 = relative to day */
"tz":134228528, /*user timezone = UTC+3 */
"u":20685653, /* unit appointed to this round */
//time of passing points, unix
"tm": [
//first point
{
"at":36000, /*arrival time, means 10:00 */
"ad":2100, /*deviation from arrival time, means 35 min */
"dt":36000, /*departure time */
"dd":2100 */
},
//second one
{
"at":43200, /*12:00 */
"ad":1800, /*30 min */
"dt":43200,
"dd":1800
}
],
//time limitation, without any
"sch": {
"f1":0,
"f2":0,
"t1":0,
"t2":0,
"m":0,
"y":0,
"w":0
},
//custom configuration
"cfg": {
"name":"roundName", /*route name */
"units": [
206 /*unitId to create rounds automatically */
],
"enabled":1, /* 1 means to create rounds automatically */
"roundFlags":2, /* round flags, 2 = strict order + remove finished rounds from the timeline */
"autoName":0,
"validityPeriod":86400 /* validity period to control = 24 hours */
},
"itemId":207,//route ID
"id":0,
"callMode":"create"
}
thank you for your support