Skip to content

Instantly share code, notes, and snippets.

{
"approved_at": {
"operator": "gte",
"value": "2024-01-01T00:01:00Z"
}
}
{
"status": {
"operator": "in",
"value": [
"approved",
"rejected"
]
}
}
{
"vehicles": [
{
"vin": "VIN012345678901234",
"brand": "bmw",
"tags": {
"sub-fleet": "3C88E2B5-680D-408D-9013-139580256F18"
}
}
]
const jwt = require('jsonwebtoken')
const uuid4 = require('uuid4')
const payload = {
ver: REST_API_CONFIG.version,
iss: REST_API_CONFIG.client_serial_number,
aud: REST_API_CONFIG.app_uri,
iat: Math.round(Date.now() / 1000),
jti: uuid4(),
sub: ACCESS_TOKEN,
[
0x0b, # Protocol Version is Level 11
0x00, 0x11, # Message Identifier for Vehicle Status
0x00, # Command Type for Get Vehicle Status Properties
0x01, # Property ID for VIN
0x02, # Property ID for Powertrain
0x03, # Property ID for Model name
]
{
"mileage": {
"value": 150000,
"timestamp": "2020-02-26T09:59:40.290Z"
},
"engineOilTemperature": {
"value": 99,
"timestamp": "2020-02-26T09:59:40.290Z"
},
"speed": {
{
"tirePressures": [
{
"value": {
"location": "front_left",
"pressure": 2.31
},
"timestamp": "2020-02-26T09:59:40.290Z"
},
{
{
"washerFluidLevel": {
"value": "filled",
"timestamp": "2020-02-26T09:59:40.290Z"
}
}
{
"locks": [
{
"value": {
"location": "front_left",
"lock_state": "unlocked"
},
"timestamp": "2020-02-26T09:59:40.290Z"
},
{