Mobile SDK

iOS or Android

API Reference - pims.vehicle.event-tripNDrive

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

Subscribe on notifications about tripNDrive events.

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

Action name, in this case tripNDrive.

String

tripNDrive

tripNDrive true
Output Data
Data name Description Type Unit/Values Example
event

Event description.

String

- CEAError <error_code>-<error_subcode> : <error_text>

- migrationBegin

- migrationEnd

- noMigration

- Database error : Problem initializing SmartApps
CEAError <error_code>-<error_subcode> : <error_text>
Error
Error Code Error Label
2001

Facade not initialized

2005

Duplicate command

Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Subscribe, see unsubscribe below */
pims.subscribe("pims.vehicle.event",
  mapOf( /* parameters */  
    Pair("actionType", "tripNDrive")
  ) 
) { message -> when (message["status"] as? String) {
      "SUCCEEDED" -> { }                          // handle succeeded status
      "FAILED" ->    { }                          // handle failed status
      "RESULT" ->    {
        if(message["error"] != null) { }            // handle error event code
        else { }                                 // handle result event code
      }
  } }

/* Unsubscribe */
pims.unsubscribe( "pims.vehicle.event" /* no params */ )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Subscribe, see unsubscribe below */
pims.subscribe(api: "pims.vehicle.event",
  parameters: [  
  "actionType": "tripNDrive"
  ]
  ) { (message) in 
    if message["status"] == "SUCEEDED"    { }    // handle succeeded status
    else if message["status"] == "FAILED" { }    // handle failed status
    else if status == "RESULT" {
      if !message["error"].isEmpty { }            // handle error event code
      else { }                                    // handle result event code
    }
  } 

/* Unsubscribe */
pims.unsubscribe( api: "pims.vehicle.event" /* no params */ )
1
2
3
4
5
6
// representation of the `succeeded` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "SUCCEEDED",
  "result": null
}
1
2
3
4
5
6
7
8
// representation of the `result` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "RESULT",
  "result": { 
    "event": "CEAError &lt;error_code&gt;-&lt;error_subcode&gt; : &lt;error_text&gt;"
  } 
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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: 2005 -------- */
{
  "transactionId": "953cfefb-bc72",
  "status": "FAILED",
  "error": {
    "code": 2005,
    "label": "Duplicate command"
  }
}