Mobile SDK

iOS or Android

    API Reference - pims.vehicle.event-sendToNav

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

    This api allows to be notified when a navigation is sent with pims.vehicle.destination or when old navigation are removed from cache.

    Events are received when a navigation is successfully sent to the vehicle or when a navigation is removed from cache (after 24h).

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

    Action name, in this case sendToNav.

    String

    sendToNav

    sendToNav true
    Output Data
    Data name Description Type Unit/Values Example
    vin

    Vehicle Identification Number

    String

    n/a

    VR1AB12C3D4567890
    Location

    Location destination of the nav send. This field is returned when a navigation is successfully sent.

    Object

    /
    Location
     .latitude

    latitude value

    Double

    n/a

    48.77232
    Location
     .longitude

    longitude value

    Double

    n/a

    2.2151043
    Location
     .address

    address value

    String

    n/a

    Rte de Gisy, 78140 Vélizy-Villacoublay
    userid

    User id value. This field is returned when a navigation is successfully sent.

    String

    n/a

    user@provider.tld
    message

    Deletion message. This field is returned when a navigation is deleted from cache.

    String

    Some locations have been removed.

    Some locations have been removed.
    Error
    Error Code Error Label
    2001

    Facade not initialized

    2301

    Need Basic Authentication (to get CVS token)

    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", "sendToNav")
      ) 
    ) { 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": "sendToNav"
      ]
      ) { (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
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    // representation of the `result` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "RESULT",
      "result": {
        "vin": "VR1AB12C3D45678909",
        // If a navigation is successfully sent
        "location": {
          "latitude": 48.77232,
          "longitude":  2.2151043,
          "address": "Rte de Gisy, 78140 Vélizy-Villacoublay"
        }
        "userid": "user@provider.tld"
        // If a navigation is deleted from cache
        "message": "Deletion message."
      }
    }
    
    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: 2301 -------- */
    {
      "transactionId": "953cfefb-bc72",
      "status": "FAILED",
      "error": {
        "code": 2301,
        "label": "Need Basic Authentication (to get CVS token)"
      }
    }