Mobile SDK

iOS or Android

API Reference - pims.vehicle.statistics-consumption

Info: Stellantis Mobile SDK for ex Groupe PSA brands (Citroën, DS, Peugeot, Opel and Vauxhall) is not publicly available yet.
Available since: v2.1
Component:
  • TripNDrive
Security: Authentication is required.
Operation:

Returns the total consumption in Trips during the requested time period.

Input Parameter
Param name Description Type Unit/Values Example Required
action

Action Name, in this case consumption.

String

consumption

consumption true
vin

Vehicle Identification Number

String

n/a

VR1AB12C3D4567890 true
period

Time period of the statistics.

Enum of String

- day

- week

- month

- year

- beginning
day true
Output Data
Data name Description Type Unit/Values Example
fuelComsumption

Sum of Trips fuel consumption during the period.

Number

n/a

3600
otherEnergyComsumption

Sum of Trips ‘other’ consumption during the period.

Number

n/a

3600
Error
Error Code Error Label
2001

Facade not initialized

2101

Missing [PARAMETER] parameter

2102

Invalid [PARAMETER] parameter

Code Example
1
2
3
4
5
6
7
8
9
10
11
pims.get("pims.vehicle.statistics",
  mapOf( /* parameters */  
    Pair("action", "consumption"),
    Pair("vin", "VR1AB12C3D4567890"),
    Pair("period", "day")
  ) 
) { message -> when (message["status"] as? String) {
      "SUCCEEDED" -> { }                          // handle succeeded status
      "FAILED" ->    { }                          // handle failed status
  } }
1
2
3
4
5
6
7
8
9
10
11
pims.get(api: "pims.vehicle.statistics",
  parameters: [  
  "action": "consumption",
  "vin": "VR1AB12C3D4567890",
  "period": "day"
  ]
  ) { (message) in 
    if message["status"] == "SUCEEDED"    { }    // handle succeeded status
    else if message["status"] == "FAILED" { }    // handle failed status
  } 
1
2
3
4
5
6
7
8
9
// representation of the `succeeded` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "SUCCEEDED",
  "result": { 
  "fuelComsumption": "3600",
  "otherEnergyComsumption": "3600"
} 
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// representation of the `failed` dictionary objects messages as JSON

/* -------- STATUS FAILED: 2001 -------- */
{
  "transactionId": "953cfefb-bc72",
  "status": "FAILED",
  "error": {
    "code": 2001,
    "label": "Facade not initialized"
  }
}
/* -------- STATUS FAILED: 2101 -------- */
{
  "transactionId": "953cfefb-bc72",
  "status": "FAILED",
  "error": {
    "code": 2101,
    "label": "Missing [PARAMETER] parameter"
  }
}
/* -------- STATUS FAILED: 2102 -------- */
{
  "transactionId": "953cfefb-bc72",
  "status": "FAILED",
  "error": {
    "code": 2102,
    "label": "Invalid [PARAMETER] parameter"
  }
}