1

Help using the api to get vehicle info out of our Wailon account

(21/03/2021 00:34:56 отредактировано alphatrackza)

Тема: Help using the api to get vehicle info out of our Wailon account

Hello I am new to this api for Wailon. However we have been using the Wailon platform for over 2 years now.

I need to be able to extract from the database the KM of the vehicle every day into an external database in order to run and manual fuel and km capture application to calculate km/liters.

The customer does not want to use any form of fuel sensors etc.

I watched your Video Diana and is was very informative, however it seems very difficult to start not know how to get going.

Please can someone assist me in just starting off to just get the basic going so i can learn from those guided steps and then grow from that.

I trust I am making sense here.

Thanks

Mike

2

Help using the api to get vehicle info out of our Wailon account

Re: Help using the api to get vehicle info out of our Wailon account

Hi Mike!

Thank you for your feedback.
If you need to look through basic topic for Remote API I would recommend you to watch my webinar about authorization into system, also to get basic information about Remote API you can watch our old video lessons (just the topic about login into the system is not actual yet, as now it's used token authorization which I have described in my webinar above)

Regarding data which you need get :
You can upload trips events from unit, where you can find parameter "distance" - GPS mileage in trip, in meters
Then summarize mileage for all trips during the day period

First request load trips, then get trips interval , we can use one request events/load with correct parameter 'selector'

For example, let get data from 22 March

https://hst-api.wialon.com/wialon/ajax.html?svc=events/load&params={"ivalType":1,"itemId":21728414,"timeFrom":1616371200,"timeTo":1616457599,"measure":0,"detectors":[{"type":"trips","filter1":0}],"selector":{"type":"trips","timeFrom":1616371200,"timeTo":1616457599,"detalization":35}}&sid=0240a80667eb11711d5ae499c4ebf858

Response

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

{
    "events": {
        "trips": {
            "0": 2
        }
    },
    "states": {
        "trips": {
            "updateTime": 1615410000
        }
    },
    "selector": {
        "trips": {
            "0": [
                {
                    "from": {
                        "t": 1616413445,
                        "y": 50.3576011658,
                        "x": 14.3170003891
                    },
                    "to": {
                        "t": 1616413734,
                        "y": 50.747756958,
                        "x": 14.1247472763
                    },
                    "m": 1616414034,
                    "f": 0,
                    "state": 1,
                    "max_speed": 100,
                    "curr_speed": 0,
                    "avg_speed": 1456,
                    "distance": 116905,
                    "odometer": 1695667582,
                    "course": 0,
                    "altitude": 300,
                    "pos_flags": 0,
                    "format": {
                        "distance": "117 km",
                        "avg_speed": "1456 km/h"
                    }
                },
                {
                    "from": {
                        "t": 1616414214,
                        "y": 50.747756958,
                        "x": 14.1247472763
                    },
                    "to": {
                        "t": 1616414491,
                        "y": 50.5901756287,
                        "x": 14.1474742889
                    },
                    "m": 1616414791,
                    "f": 0,
                    "state": 1,
                    "max_speed": 150,
                    "curr_speed": 0,
                    "avg_speed": 372,
                    "distance": 28651,
                    "odometer": 1695784487,
                    "course": 0,
                    "altitude": 300,
                    "pos_flags": 0,
                    "format": {
                        "distance": "29 km",
                        "avg_speed": "372 km/h"
                    }
                }
            ]
        }
    }
}

Diana Cheley
Wialon Hosting Expert
Gurtam