26

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello chdi,

Thanks for your last update, Need your more help to execute the report with the group 

to exexute report with single unit as its working fine,

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/exec_report&params={"reportResourceId":55874,"reportTemplateId":10,"reportObjectId":20646,"reportObjectSecId":0,"interval":{"from":1601449803,"to":1601877534,"flags":0}}&sid=38e426df6995780573aad7a2ce59732f

but how i can report for the group of units


i have group id 63926 and list of units in the group

[20306,54533,55304]

params={
  "reportResourceId": 55874,
  "reportTemplateId": 10,
  "reportObjectId": 63926,
  "reportObjectSecId": 0,
  "reportObjectIdList":[20306,54533,55304],
  "interval": {
    "from": 1601449803,
    "to": 1601877534,
    "flags": 0
  }
}&sid=38e426df6995780573aad7a2ce59732f
27

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.

Diana Cheley
Wialon Hosting Expert
Gurtam
28

How to get Unit Last update date and time

(19/11/2020 15:07:59 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

chdi пишет:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

29

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah пишет:
chdi пишет:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

Hello !

you need to specify the report templates id in "col", like "col":[1,2,5,10] for example

Diana Cheley
Wialon Hosting Expert
Gurtam
30

How to get Unit Last update date and time

(23/11/2020 12:08:27 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

chdi пишет:
trushal.shah пишет:
chdi пишет:

Hello, trushal.shah !

To execute group report first please make sure that report temlate is for group (check on interface or via request report/get_report_data - in resposne parameter "ct":"avl_unit_group")
Then you can pass group id ( 63926 ) in "reportObjectId" ("reportObjectId" always should have value), report will be executed for all unitns in this group.

Also you can pass list (items id) of additioal units or groups in parameter "reportObjectIdList".

It doesn't need to pass id of units from group in  "reportObjectId", the parameter "reportObjectIdList" is empty ("reportObjectIdList":[]) if you execute report only for one group.


thanks for the response,

How i can get groups templates and unit template list which API should i call ?

http://gps.tawasolmap.com/wialon/ajax.html?svc=report/get_report_data&params={"itemId":55874,"col":[]}&sid=bc9c650e4b732d33ed2a04c91528df20

in response i am getting

[]

Hello !

you need to specify the report templates id in "col", like "col":[1,2,5,10] for example


Thank you for your reply, that is my query how i can get that report templates ids like which template belong to units and which is for the unit groups

i need this for the report page

31

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah !

If the reports templates ids are already known, you can get report type (unit or unit group) via request report_get_report_data
If no, you can get report templates ids and  template type via request search item - you need to search required resource where reports created and get information about report (flag for reports templates data  - https://sdk.wialon.com/wiki/en/sidebar/ … templates)
For example,  search resource by its name, flag = 8192 will return information about report templates

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=027326aeaef91fb9a10eed84d3b

params: {"spec":{"itemsType":"avl_resource","propName":"rel_is_account,sys_name","propValueMask":"1,*di*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}

response

{"rep":{"1":{"id":1,"n":"Report WatchLock","ct":"avl_unit","c":57059},"2":{"id":2,"n":"Driver report","ct":"avl_driver","c":52959},"3":{"id":3,"n":"гео diand","ct":"avl_unit","c":44292}},"repmax":0},{"rep":{"1":{"id":1,"n":"Diana","ct":"avl_unit","c":31607},"2":{"id":2,"n":"Новый отчет","ct":"avl_unit","c":46749},"3":{"id":3,"n":"Month report","ct":"avl_unit_group","c":13735}},"repmax":-1}
Diana Cheley
Wialon Hosting Expert
Gurtam
32

How to get Unit Last update date and time

(24/11/2020 16:24:43 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

chdi пишет:

Hello trushal.shah !

If the reports templates ids are already known, you can get report type (unit or unit group) via request report_get_report_data
If no, you can get report templates ids and  template type via request search item - you need to search required resource where reports created and get information about report (flag for reports templates data  - https://sdk.wialon.com/wiki/en/sidebar/ … templates)
For example,  search resource by its name, flag = 8192 will return information about report templates

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=027326aeaef91fb9a10eed84d3b

params: {"spec":{"itemsType":"avl_resource","propName":"rel_is_account,sys_name","propValueMask":"1,*di*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}

response

{"rep":{"1":{"id":1,"n":"Report WatchLock","ct":"avl_unit","c":57059},"2":{"id":2,"n":"Driver report","ct":"avl_driver","c":52959},"3":{"id":3,"n":"гео diand","ct":"avl_unit","c":44292}},"repmax":0},{"rep":{"1":{"id":1,"n":"Diana","ct":"avl_unit","c":31607},"2":{"id":2,"n":"Новый отчет","ct":"avl_unit","c":46749},"3":{"id":3,"n":"Month report","ct":"avl_unit_group","c":13735}},"repmax":-1}

Thanks for replay

how i can use this "propValueMask":"1,*di*"

because with this i am not able to get data but if I set only with "propValueMask":"*" getting data

but getting  44 records but i can see there is just a few templates associate with an account with wialon mobile applications

please check the attached screenshot, i have taken from wialon application tab report click

  • How to get Unit Last update date and time
33

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

In "propValueMask" you can set up a full element name (mask), or part with * as mask, or leave :"*"  which means any name (any value).
For example, "propValueMask":"1,*di*"  means element with exact name '1' and elements' names contains 'di'
In my example above it's request to search element (resource) by 2 criteria ("propName":"rel_is_account,sys_name", "propValueMask":"1,*di*") : rel_is_account is 1 (account status) and sys_name (element name) contains 'di'

In your case you can apply full resource name in "propValueMask" - the system will search resource(account) by this name and return data about reports templates created in this resource.
Also you can search item only by 1 criteria (by name)

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&sid=026cba6349a502333fe462d&params={"spec":{"itemsType":"avl_resource","propName":"sys_name","propValueMask":"*res_name*","sortType":"sys_name"},"force":1,"flags":5,"from":0,"to":19}
Diana Cheley
Wialon Hosting Expert
Gurtam
34

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Thanks for all your message,

as your last update that we can not send a push notification with wialon API,

then how i can send any link or any  support that I can set in my application to get notification same as wialon does

also that how I can get a list of notification that user get on a set of notification

i have attached three screenshots that I need to integrate this flow in my current application how i can do that which APi should is use

1) get List of notifications as per request
2) Any support URL that i can integrate to set push notifications the same as wialon app

thanks for your support again

  • How to get Unit Last update date and time
  • How to get Unit Last update date and time
  • How to get Unit Last update date and time
35

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello trushal.shah!

could you please write me to email chdi@gurtam.com , that we can discuss about some details regarding your app.

Diana Cheley
Wialon Hosting Expert
Gurtam
36

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi пишет:
trushal.shah пишет:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320

As this works perfect for us, but here with a response

"type":"trips"

we are not getting idle or parking details of the unit, if you can please help me with which parameter we should update to get all unit trip details with movement and, parking

37

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hi trushal.shah,

there is not registered parking evetns. There are calculated on web-part. When you can 'trips' event, you get trip start and trip end ("from" / "to"), so you need to calculate parking as beetween end of 1 trip and start 2d trip.

For example, the return result from the day

{"trips":{"0":[{"from":{"t":1606820862,"y":46.1797103882,"x":-123.037498474},"to":{"t":1606821362,"y":46.1567115784,"x":-123.059989929},"m":1606821662,"f":0}]},{"1":[{"from":{"t":1606825022,"y":46.1567115784,"x":-123.059989929},"to":{"t":1606825622,"y":46.1567115784,"x":-123.059989929},"m":1606821897,"f":0}]}}

So 1st parking was till to "t":1606820862 (11:07:42 UTC+0) , the second parking from  1606821362 (1st trip end) to 160682502 (2nd trip begin) with duration 1606821362 - 1606825022 = 3660 sec = 1 h 1 min
The next parking will be from 1606825622 (2d trip end) till next trip begining

Diana Cheley
Wialon Hosting Expert
Gurtam
38

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi пишет:

Hi trushal.shah,

there are not registered parking events. There are calculated on web-part. When you can 'trips' event, you get the trip start and trip end ("from" / "to"), so you need to calculate parking as between the end of 1 trip and start 2d trip.

For example, the return result from the day

{"trips":{"0":[{"from":{"t":1606820862,"y":46.1797103882,"x":-123.037498474},"to":{"t":1606821362,"y":46.1567115784,"x":-123.059989929},"m":1606821662,"f":0}]},{"1":[{"from":{"t":1606825022,"y":46.1567115784,"x":-123.059989929},"to":{"t":1606825622,"y":46.1567115784,"x":-123.059989929},"m":1606821897,"f":0}]}}

So 1st parking was till to "t":1606820862 (11:07:42 UTC+0) , the second parking from  1606821362 (1st trip end) to 160682502 (2nd trip begin) with duration 1606821362 - 1606825022 = 3660 sec = 1 h 1 min
The next parking will be from 1606825622 (2d trip end) till next trip begining


Thanks for your reply,

its works for us to get some movement of the unit with the center of the day but I am not getting if in the parking with start and endpoint

The first trip end time (to time) will be the starting of the parking time(from the time) and the second trip start time will be the end time of the parking event and so on we are calculating parking detail between all the trips.

1. How we can calculate the first parking event of the day which is shown in the attached image as point 1
2. How we can calculate the last parking event of the day which is shown in the attached image as point 2
- If it is the same day event then we are considering the current time as the end time of the last parking event, but for the last day we have considered the end time of the day 11:59 PM but we are not able to calculate that data

  • How to get Unit Last update date and time
39

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1. To calculate the first parking in day it depend on your goal, for example you can group events by days, so the day starts from 00:00 to 23:59
and cut the event by begin/end of day.
So to calculate first parking you just calculate time from 00:00 to start 1st trip.
2. The last parking event you can calculate by the end of the day (23:59) , if the day was at history. If it's current day you can calculate by current time
For example, the last trip was end at 09:00 AM, now current time is 9:31, so the current parking is 32 min

Diana Cheley
Wialon Hosting Expert
Gurtam
40

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi пишет:

Hello!

1) Last data information (unit name, speed, position, date/time) you can get via request search item (or search items ) with correspodings flags value.

2) Engine status , moving/parking status you can get via Events - trips and igntion 
To get live events the steps are the following

  • Then execute request events/check_updates, for example every 2-5 sec, to get response with online data

For example

1. First (after login) it needs to add required units to session via request  svc=events/update_units

https://hst-api.wialon.com/wialon/ajax.html?svc=events/update_units&params={"mode":"add","units":[{"id":2147,"detect":{"ignition":0,"trips":0}},{"id":2174,"detect":{"ignition":0,"trips":0}}]}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"units" - units array where  'id' - unit's id, 'detect' - required events types, in our case only "ignition":0 and trips "trips":0, 0 means all ignition sensors, if you know that unit has only 1 ignition sensor, you can set up '0'.
If there is several ignition sensors it's better to set up sensor's id. But sure it depends on appropriate business task. For trips is always 0 ("trips":0).
It needs to specify for each units 'id' each 'detect' type.

2. After required units has been added to session, we can monitor online ingtion state via request events/check_updates which can be executed for example every 2 sec or rarely , it depends on how often the device sends data to the server

https://hst-api.wialon.com/wialon/ajax.html?svc=events/check_updates&params={"detalization":3}&sid=023078baa1999df1ea0da05cd4cbc9a02cb

"detalization":3  means that server will return  JSON information for flags plus


This is working for us properly , Here how we should manage engine status for below conditions how we should get flags in the response of this



Hello if you can please help me to get unit engine status with the bellow cases

How i can get it from API

1) Add key next to the icon when the engine starts it : Green with key when Vehicle is moving and the engine is on,

2) Red with key when the Vehicle stop and the engine is on,

3) Green only if the Vehicle moving without start engine so no key in this situation & red without key if the Vehicle stops and the engine off.


what we have considered that if speed is > 0 then engine status is ON and Speed = 0 then engine status is off but how we should calculate that speed with and engine status with current screens shots

  • How to get Unit Last update date and time
  • How to get Unit Last update date and time
41

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

As this status is online, you need to get events in online mode, for this it needs to use get
You can get current online trips and ignition, please look below the detailed example.

+ открыть спойлер

To control online current ignition state it can be used request  events/check_updates
http://sdk.wialon.com/wiki/en/sidebar/r … ck_updates

1. First (after login) it needs to add required units to session via request  svc=events/update_units
http://sdk.wialon.com/wiki/en/sidebar/r … date_units

https://hst-api.wialon.com/wialon/ajax.html?svc=events/update_units&params={"mode":"add","units":[{"id":21080147,"detect":{"ignition":0,"trips":0}},{"id":21728414,"detect":{"ignition":0,"trips":0}}]}&sid=02abb0c22bb8a9cc5df633a630bcbbfb

"units" - units array where  'id' - unit's id, 'detect' - required events types, in our case only "ignition":0 and trips "trips":0, 0 means all ignition sensors, if you know that unit has only 1 ignition sensor, you can set up '0'.
If there is several ignition sensors it's better to set up sensor's id. But sure it depends on appropriate business task. For trips is always 0 ("trips":0).
It needs to specify for each units 'id' each 'detect' type.

2. After required units has been added to session, we can monitor online ignition state via request events/check_updates which can be executed for example every 2 sec or rarely , it depends on how often the device sends data to the server

https://hst-api.wialon.com/wialon/ajax.html?svc=events/check_updates&params={"detalization":3}&sid=023078baa1df1ea0da05cd4cbc9a02cb

"detalization":3  means that server will return  JSON information for flags plus

First response


{"21080147":[{"ignition":{"1":{"from":{"t":1590045850,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046021,"y":43.79845047,"x":-99.7432632446},"m":1590046021,"f":0,"state":0,"type":1,"hours":175782,"switches":2,"value":0}}}]}

21 May 2020 07:24:10 - 21 May 2020 07:27:01 = time from / to
"state":0 - ignition is Off
So during 2 min 51 sec ignition has being Off

Next request svc=events/check_updates
Response
{} - empty answer  means nothing changes as there is not yet new messages coming

new message with time 05-21-2020 07:33:36 coming, due to several second event has been recalculated

{"21080147":[{"ignition":{"1":{"from":{"t":1590045850,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046416,"y":43.79845047,"x":-99.7432632446},"m":1590046416,"f":0,"state":0,"type":1,"hours":175782,"switches":2,"value":0}}}]}

21 May 2020 07:24:10
21 May 2020 07:33:36

Ignition switched to On , new messages with time 05-21-2020 07:36:02 coming , new interval with state = 1 has been calculated


{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"m":1590046562,"f":0,"state":1,"type":1,"hours":175782,"switches":3,"value":1}}}]}

21 May 2020 07:36:02
21 May 2020 07:36:02

messages still coming with ignition On, event with state =1  recalculated with every new messages (delay can be about 1-3 sec, but if device sends data from black-box memory, the delay for recalculation can be more, even about 1 hour)

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046706,"y":43.79845047,"x":-99.7432632446},"m":1590046706,"f":0,"state":1,"type":1,"hours":175926,"switches":3,"value":1}}}]}

{}

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046767,"y":43.79845047,"x":-99.7432632446},"m":1590046767,"f":0,"state":1,"type":1,"hours":175987,"switches":3,"value":1}}}]}

{"21080147":[{"ignition":{"1":{"from":{"t":1590046562,"y":43.79845047,"x":-99.7432632446},"to":{"t":1590046777,"y":43.79845047,"x":-99.7432632446},"m":1590046777,"f":0,"state":1,"type":1,"hours":175997,"switches":3,"value":1}}}]}

So after every request  events/check_updates  you will get  {} answer which means nothing was change  or recalculation with new time or state.
On your side you can calculate difference between time from/to as duration of current state.

Diana Cheley
Wialon Hosting Expert
Gurtam
42

How to get Unit Last update date and time

(17/12/2020 13:08:02 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

Hi, thanks for your help and support

I want to bind the driver with a unit with a code or password

I can do create Driver with the below API it's working for me

resource/update_driver&params={"itemId":1299,"id":0,"callMode":"create","ej":"","c":"123456","ck":0,"ds":"Joy testing as driver","n":"Joy driver","p":" %2B1234567","r":0,"f":4,"pwd":"123456","jp":""}

                  
I can bind driver with unit
       

svc=resource/bind_unit_driver&params={"resourceId":1299,"unitId":1233,"driverId":1,"time":0,"mode":1}

How I can bind drive with a specific password of code which added on create a driver

for e.g i create one driver ABCD with code='123456' and password= 'ABCD'

and while the driver click to bind with the unit he/she needs to add their code

how to set bind driver with a passcode  if you can please help me

Also please help me how i can get all list of register drivres

43

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

1. The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.

2. To get binding/unbinding of a driver for specified period of time use the request svc=resource/get_driver_bindings
To get list of binded drivers for specific unit - svc=resource/get_unit_drivers
To get all created drivers in resource(s) - use request search_item/search_items (search resource) with flags = 256 ( https://sdk.wialon.com/wiki/en/sidebar/ … ce#drivers )

Diana Cheley
Wialon Hosting Expert
Gurtam
44

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi пишет:

The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.


so there is no such API where we can post driver id and password before bind driver with the unit?

45

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

trushal.shah пишет:
chdi пишет:

The password in drivers settings it's only used in mobile logistics app for the driver. http://apps.wialon.com/docs/en/logistics.html
Sure you can use this property another way in your app. For example, when user click to bind driver it (manually binding) it will the alert window where it needs to confirm password
But in Wialon system there is not such functional.


so there is no such API where we can post driver id and password before bind driver with the unit?

there is not such possibility in Wialon.

Diana Cheley
Wialon Hosting Expert
Gurtam
46

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

chdi пишет:
trushal.shah пишет:

Thanks for the solutions,

Last point that how I can get the movement of the units with start and [Between each] endpoint the day, or between dates

Hello!

To get history data of events (trips, ignition) you need to execute  events/load & events/get
First you load events for some period  - , then get  it
For example,

Get trips from Oct 1 - Oct 5 , unix time UTC+0

Load events

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":214,"timeFrom":1601510400,"timeTo":1601942399,"detectors":[{"type":"trips","filter1":0}]}&sid=028384ac3f02f18c414208758685b320

Get result

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1601942399,"detalization":3}}&sid=028384ac3f028758685b320


Hello I need to know that as suggested API to get history of trips and its workig like charm, but here we get differet on display rooth path on the map,


svc=events/get

get a response from APi with start and end location

"trips": {
        "0": [
            {
                "from": {
                    "t": 1608526381,
                    "y": 24.7762775421,
                    "x": 46.6249923706
                },
                "to": {
                    "t": 1608527106,
                    "y": 24.7713947296,
                    "x": 46.6237869263
                }

and we use this start and end location as in the below API of the google

https://maps.googleapis.com/maps/api/directions/json?origin=\(source.latitude),\(source.longitude)&destination=\(destination.latitude),\(destination.longitude)&sensor=false&mode=driving&key=\(API_KEY)")

but we are getting the wrong path to compare to Wialon track location path at history page ,

if you can please help me that how i can get this root location from start to endpoint

  • How to get Unit Last update date and time
  • How to get Unit Last update date and time
47

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

The Wialon is displayed track using Google Polyline Algorithm
When you request trips events, you can get such track in parameter  , just add flag ("detalization")  = 8

For example,

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1608551874,"detalization":9}}&sid=06f3f79ddfad80414a4db

Response

{"trips":{"0":[{"from":{"t":1608377059,"y":46.8571205139,"x":-122.974449158},"to":{"t":1608377259,"y":46.826374054,"x":-122.963294983},"m":1608377483,"f":2,"track":"_x~|GfmqmV??????lo@wdA????vnC?????"},{"from":{"t":1608379499,"y":46.826374054,"x":-122.963294983},"to":{"t":1608379749,"y":46.8789367676,"x":-122.876327515},"m":1608379749,"f":2,"track":"ywx|GngomV??????????????ogI??o~O??"}

Then you can decode 'track' via Google Decode Polyline

Diana Cheley
Wialon Hosting Expert
Gurtam
48

How to get Unit Last update date and time

(22/12/2020 17:46:48 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

chdi пишет:

Hello!

The Wialon is displayed track using Google Polyline Algorithm
When you request trips events, you can get such track in parameter  , just add flag ("detalization")  = 8

For example,

https://hst-api.wialon.com/wialon/ajax.html?svc=events/get&params={"selector":{"type":"trips","timeFrom":1601510400,"timeTo":1608551874,"detalization":9}}&sid=06f3f79ddfad80414a4db

Response

{"trips":{"0":[{"from":{"t":1608377059,"y":46.8571205139,"x":-122.974449158},"to":{"t":1608377259,"y":46.826374054,"x":-122.963294983},"m":1608377483,"f":2,"track":"_x~|GfmqmV??????lo@wdA????vnC?????"},{"from":{"t":1608379499,"y":46.826374054,"x":-122.963294983},"to":{"t":1608379749,"y":46.8789367676,"x":-122.876327515},"m":1608379749,"f":2,"track":"ywx|GngomV??????????????ogI??o~O??"}

Then you can decode 'track' via Google Decode Polyline

Hello Thanks for the reply

https://sdk.wialon.com/wiki/en/kit/remoteapi/apiref/events/get#x1_flag

("detalization")  = 8

Which flag I should post that I can get all the details of the trip in a single response

distance key and engine hours with the same response where we get to track of the units

49

How to get Unit Last update date and time

Re: How to get Unit Last update date and time

Hello!

You can apply "detalization":256.

Diana Cheley
Wialon Hosting Expert
Gurtam
50

How to get Unit Last update date and time

(28/12/2020 16:56:08 отредактировано trushal.shah)

Re: How to get Unit Last update date and time

Diana пишет:

Hello!

There is not quotes for text parameters, like "pageOrientation":portrait, "coding":utf8 and etc.

the correct params

{"format":2,"pageOrientation":"portrait","pageSize":"a4","pageWidth":0,"coding":"utf8","delimiter":"semicolon","headings":0,"compress":1,"attachMap":0,"extendBounds":0,"hideMapBasis":0,"outputFileName":"Online_report"}

Hello thanks for your support

In the report, I request

Between date from 27/12/2020 00:00 AM
Between date To 27/12/2020 11:59 PM

exec_report API:

{"reportObjectSecId":0,"reportObjectId":20306,"interval":{"flags":0,"to":1609113599,"from":1609027200},"reportResourceId":"62290","reportTemplateId":1}"

exec_result API

"extendBounds":0,"pageWidth":0,"format":2,"headings":0,"coding":"utf8","pageSize":"a4","pageOrientation":"portrait","delimiter":"semicolon","attachMap":1,"outputFileName":"eabdalmnem_27/12/2020","hideMapBasis":1,"compress":0}

Above both API working and we are getting report as PDF file

But here the issue is we are not getting proper data with the above post formates

we use to get date as UTC time [timeFormatter.timeZone = TimeZone(abbreviation: "UTC")]

Please check two diff response screenshots

Initial location, Final location, Duration this data are coming proper

But Beginning time and End time coming wrong

  • How to get Unit Last update date and time
  • How to get Unit Last update date and time