1

Unit Realtime API

(edited by chanden 14/07/2023 12:53:04)

Topic: Unit Realtime API

Dear Wialon,

Good day to you!

Could you please advise me how to get Unit with realtime data (Location , speed, gelocator) as Websocket ?.

Thanks.

2

Unit Realtime API

Re: Unit Realtime API

chanden hello, in order to start using Wialon API you need to generate token with authorization and then login with this token to generate session ID (sid). This sid should be used in your further requests. In order to get information for all available units, you can use search_items request with flags value 1025

Sample of the request execution -- https://sdk.wialon.com/wiki/en/sidebar/ … y_property

In case you need only GPS data, you can try to use retranslation. Configure retranslator in Wialon. The data will be sent to your server according to the selected protocol.
The list of the integrated protocol you can find here -- https://gurtam.com/en/gps-hardware/soft

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
3

Unit Realtime API

Re: Unit Realtime API

Dear Wialon,

I would like to ask you  some questions as below :

1. Is it possible request unit with geocode in per request :
    EX: https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&params={"spec": {"itemsType": "avl_unit","propName":"sys_name","propValueMask": "*","sortType":"sys_name","or_logic":"0"},"force": 1,"flags":13644935,"from": 0,"to": 0}&sid=10ec4aa7b154a9fc0ac124fbf4d7537f

2. Could you advise me how to get all vehicle status as below:
  - Online
  - Offline
  - Stationary
  - Stationary with ignition on
  - Moving
  - LBS detected
  - No actual state
  - No Message

3. How to get Sensors status as below :
   - Ignition
   - Amount of fuel

Please kindly to check my attached file

  • Unit Realtime API
  • Unit Realtime API
  • Unit Realtime API
4

Unit Realtime API

Re: Unit Realtime API

chanden good day.
1. You can only get a coordinates with last location of the units. You need to add flags value of 1024. Then you can use coordinates into [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/requests/address]gis_geocode[/code] request as pet the [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/codesamples/address_coords]example[/code].

2. Most of the data can be received via search_items or search_item requests.
Online/Offline state regulates with 2097152 flags
Stationary/Moving state can be determine as per the speed value in the last message. Flag 1024
LBS detected, No actual state, No Message -- presumably, these states you can check requesting lat message with corresponding [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/messages/load_last]request[/code].
Possible parameters and description you can find [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/format/messages#message_with_data]here[/code].

3. In order to get sensors values, you can use two different options:
- Via [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/unit/calc_last_message]calc_last_message[/code] request. The reply shows sensors values from the last message by the sensors ID. In order to determine sensor ID you can use search_items request with flags value 4096
- you can use [code=https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/events/events]events[/code] to control sensors states changes. This option describe in the [code=https://www.youtube.com/live/nUtNS5Al5wo?feature=share]webinar[/code].

Let me know if you have any additional questions.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
5

Unit Realtime API

(edited by chanden 02/08/2023 12:34:28)

Re: Unit Realtime API

Dear zant,

Good day to you,

My problem not solve with stationary with ignition on .

Could you give an example how to count stationary and stationary with ignition on.

Pleas kindly check my attached file .

Thanks!

  • Unit Realtime API
  • Unit Realtime API
6

Unit Realtime API

Re: Unit Realtime API

chanden hello, in order to determine such status you can control two values - ignition sensor value and speed value. Thus if the ignition is ON, but speed value is below minimum moving speed specified in the trip detector - this is stationary with Ignition ON.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
7

Unit Realtime API

Re: Unit Realtime API

Dear zant,

Thanks for your super support .

One more thing ,

Is it possible to executing several commands API at once as below:
1.Parking
2.Count km
3. Km/H
4.Fuel
5.Route on map

Please kindly help to check my attached file

  • Unit Realtime API
8

Unit Realtime API

Re: Unit Realtime API

chanden hello, in this case you can try to use events. You need to add units into the session with required parameters. Then you can check updates of the events.
Here you can watch events video tutorial -- https://www.youtube.com/watch?v=nUtNS5Al5wo

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
9

Unit Realtime API

Re: Unit Realtime API

Thank for the reply,

i do execute with this url : https://hst-api.wialon.com/wialon/ajax.html?svc=report/exec_report&params={"reportResourceId":26768527,"reportTemplateId":1,"reportObjectId":1,"reportObjectSecId":0,"interval":{"from":1690879883,"to":1691743883,"flags":0}}&sid=105e727acae1c014885dc47d9b18cbdf

getting error in API error : 7

One more thing,
How to get  reportResourceId, reportObjectId , reportObjectSecId

10

Unit Realtime API

Re: Unit Realtime API

chanden hello, the reportObjectId indicated incorrect. It should be internal (system) ID of the element.
In order to get it you need to execute search_items request. You can use this request to find internal ID of any item created in the system. For example, in order to find units IDs you need to set itemsType parameter value to avl_unit and set flags value 1. To get resource ID and report template ID in one execution, itemsType should be avl_resource and flags value 8193.

reportObjectSecId -- should be used if the report template created for resource content, like geofences or drivers.

Also, please, check this article regarding first steps in Wialon API -- https://wialon-help.link/1b0dd04d
It contains all initial information including search_items request description.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
11

Unit Realtime API

Re: Unit Realtime API

I would like to know more about [https://www.unicotaxi.com/gocatch-clone-appl]this

UnicoTaxi
12

Unit Realtime API

Re: Unit Realtime API

praveen hello, I think you need to contact manufacturers directly via their main website https://www.unicotaxi.com/contact-us

Anton Zinovyev
Technical Care Engineer (L2)
Wialon