get

After loading the events into the session, you can view them by executing the events/get command.

Copied!
svc=events/get&params={
    "selector":{
        "type":<text>,
        "expr":<text>,
        "timeFrom":<uint>,
        "timeTo":<uint>,
        "detalization":<uint>
    },
    ...
}

Parameters

ParameterDescription
typeSensor group: lls, trips, ignition, sensors, counters. To specify all the groups, use the asterisk (*).
exprInterval group expression. Used instead of the type parameter to get custom event intervals. See below.
timeFromInterval start, UNIX-time.
timeToInterval end, UNIX-time.
detalizationOutput flags (see below).
indexFromIndex of the first requested event.
indexToIndex of the last requested event.
filter1Sensor ID.

Flags

FlagDescription
0x1Basic JSON: event start and end.
0x2Data of a specific detector.
0x4User parameters (that the user specified for this event).
0x8Track data in the trips parameter.
0x10Full JSON. Every detector interprets it in its own way.
0x20Formatted value.
0x40Grouping the intersections of intervals with the tf and tt parameters.
0x80Summary.

Custom event intervals

To get custom event intervals, specify an expression in the “expr”: parameter instead of using the type parameter. You can use the following expression formats:

OperatorDescriptionExample
{}Used for selecting intervals with the specified value of the detalization parameter. See the example for selecting trip intervals in which the speed value exceeds 100.trips{s>100}
-Used for specifying a custom interval in the start-end format, UNIX-time.1451953325-1451953525
|Used as a separator when specifying multiple custom intervals. (1615849200-1615935599|1615935601-1616022000)
[]Sensor ID. If no ID is specified, the first sensor is used.sensors[3]

Response

If the request is completed successfully, you will receive the response corresponding to the sensor group specified in the type parameter. Otherwise, an error code is returned.

0x1 flag

Returns basic JSON (the same for all sensor groups).

Copied!
"<type_name>": {
    "<sensor_id>": {
        "from": {
            "t": <uint>,  /* time (UNIX time) */
            "y": <double>, /* latitude */
            "x": <double>  /* longitude */
        },
        "to": {
            "t": <uint>,  /* time (UNIX time) */
            "y": <double>, /* latitude */
            "x": <double>  /* longitude */
        },
        "m": <uint>,  /* last message time */
        "f": <uint>   /* service flag */
    }
}

0x2 flag

Returns data of a specific detector.

Copied!
"ignition": {
    "<sensor_id>": {
        "state": <uint>,    /* state: 0 — off, 1 — on */
        "type": 1,          /* sensor type: switcher sensor */
        "hours": <uint>,    /* engine hours for all history (in seconds) */
        "switches": <uint>, /* number of switches for all history */
        "value": <bool>     /* current value */
    }
    ...
}

Below are the possible sensor types for sensors.

Copied!
"sensors": {
"<sensor_id1>": {
"state": <uint>, /* state: 0 — off, 1 — on */
"type": 1, /* sensor type: switcher sensor */
"hours": <uint>, /* engine hours for all history (in seconds) */
"switches": <uint>, /* number of switches for all history*/
"value": <bool> /* current value */
},
"<sensor_id2>": {
"type": 2, /* sensor type: instant sensor */
"counter": <uint>, /* number of sequent messages in the event */
"summary": <uint>, /* sum of values in the event */
"total_counter": <uint>, /* total number of messages in all history */
"total_summary": <uint>, /* total value sum in all history */
"value": <double> /* last value; if -348201.3876, the value is unknown */
},
"<sensor_id3>": {
"type": 3, /* sensor type: differential sensor */
"counter": <uint>, /* sum of values in the event */
"total_counter": <uint>, /* sum of values in the history */
"value": <double> /* last value; if -348201.3876, the value is unknown */
},
"<sensor_id4>": {
"type": 4, /* sensor type: analog sensor */
"value": <double> /* last value; if -348201.3876, the value is unknown */
}
}


Copied!
"lls": {
"<sensor_id>": {
"value": <double>, /* last message value with the calculated level */
"level": <double>, /* average median value (FLS filtration applied) */
"filled": <double> /* amount of fuel filled */
}
}


Copied!
"trips": {
"state": <bool>, /* state: 0 — parking, 1 — trip, 2 — stop */
"max_speed": <uint>, /* maximum speed during the trip */
"curr_speed": <uint>, /* current speed */
"avg_speed": <uint>, /* average speed based on distance */
"distance": <uint>, /* GPS mileage during the trip */
"odometer": <uint>, /* total distance for all trips in the history */
"course": <uint>, /* course */
"altitude": <uint> /* altitude */
}

Copied!
"counters": {
"engine_hours": <uint>, /* engine hours counter */
"mileage": <uint>, /* mileage counter */
"bytes": <uint> /* GPRS traffic counter */
}

0x4 flag

Returns user parameters. The response depends on the parameters the user has specified for the event.

Copied!
"<type_name>": {
    "<sensor_id>": {
        "p": {  /* user-defined object content */
            "test": 2,
            "foo": "bar",
            "trips": 1
        }
    }
}

0x8 flag

Returns JSON with additional parameters. For trips, returns a unit track in Google notation.

Copied!
{
    "trips": {
        "0": [
            {
                "track": "wspnGgvcv@??oey@kwl@~dtBkeRwjzF??~ja@_qo]??g~g^????????????~bV???????"
            }
        ]
    }
}

0x10 flag

Returns full JSON.

For sensors with type=2 and type=3 (except fuel level sensors), the response looks as follows:

Copied!
"sensors": {
    "<sensor_id>": {
        "msgs": [
            {
                "tm": <uint>,  /* message time, UNIX time */
                "v": <double>  /* value */
            },
            ...
        ]
    },
    ...
}

For a fuel level sensor, the response looks as follows:

Copied!
"lls": {
    "<sensor_id>": {
        "msgs": [
            {
                "tm": <uint>,  /* message time, UNIX time */
                "v": <double>,  /* value */
                "l": <double>   /* average median value (FLS filtration applied) */
            },
            ...
        ]
    }
},
...

0x20 flag

Returns formatted values.

Copied!
"ignition": {
    "<sensor_id>": {
        "format": {
            "value": <text>  /* formatted value (usually On/Off) */
        }
    }
}
Copied!
"sensors": {
    "<sensor_id>": {
        "format": {
            "value": <text>  /* formatted value, depends on the sensor type and format */
        }
    }
}
Copied!
"trips": {
    "format": {
        "distance": <text>,   /* distance based on the previous message */
        "avg_speed": <text>   /* average speed in relation to "distance" */
    }
}
Copied!
"lls": {
    "<sensor_id>": {
        "format": {
            "value": <text>,   /* formatted value, depends on the sensor type and format */
            "filled": <text>   /* fuel filled */
        }
    }
}
Copied!
"counters": {
    "format": {
        "engine_hours": <uint>,  /* formatted value of the engine hours counter */
        "mileage": <text>,       /* formatted value of the mileage counter */
        "bytes": <uint>          /* formatted value of the GPRS traffic counter */ 
    }
}

0x40 flag

Copied!
"selector": [
    {
        "tf": <uint>,  /* intersection interval start (UNIX time) */
        "tt": <uint>,  /* intersection interval end (UNIX time) */
        "d": {
            "<type_name>": {
                "<sensor_id>": [
                    { }
                ]
            }
        }
    }
]

0x80 flag

Copied!
"selector": {
    "<type_name>": {
        "sensor_id>": [
            { }
        ]
    }
},
"summary": {
    "<type_name>": {
        "<sensor_id>": {
            "<summary_param_value>": <uint>,  /* summary, different for different detectors */
            "format": {
                "value": <text>  /* formatted value, depends on the sensor type and format */
            }
        }
    }
}

Error codes

CodeDescription
1Invalid or obsolete request SID.
4Parameter validation error.
7Failed to load the adf_avl_events library.
Download PDF file
Download Word document

See also