Mobile SDK

iOS or Android

    API Reference - pims.authentication.smscode-phoneNumberCertification

    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: StrongAuthentication
    Security: Authentication is required.
    Operation:

    This api allows to receive an SMS code allowing to add/modify the user account phone number.

    It is possible to check if the user already has a phone number using pims.authentication.trustedphonenumber.

    When the code is receive, it should be validated using pims.authentication.smscode - addPhoneNumber, pims.authentication.smscode - modifyPhoneNumber or pims.authentication.enrollment - enrollmentWithPhoneNumber.

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

    Type of SMS to request, in this case phoneNumberCertification.

    String

    phoneNumberCertification

    phoneNumberCertification true
    phoneNumber

    Phone number value.

    Integer

    phoneNumber

    0612345678 true
    Output Data
    No data
    Error
    Error Code Error Label
    2001

    Facade not initialized

    2006

    Core not well configured

    2101

    Missing [PARAMETER] parameter

    2102

    Invalid [PARAMETER] parameter

    2201

    Timeout/Polling Timeout/Command Timeout

    2202

    Network problem : No internet

    2204

    Server Error

    Code Example
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    pims.get("pims.authentication.smscode",
      mapOf( /* parameters */  
        Pair("type", "phoneNumberCertification"),
        Pair("phoneNumber", "0612345678")
      ) 
    ) { message -> when (message["status"] as? String) {
          "SUCCEEDED" -> { }                          // handle succeeded status
          "FAILED" ->    { }                          // handle failed status
      } }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    pims.get(api: "pims.authentication.smscode",
      parameters: [  
      "type": "phoneNumberCertification",
      "phoneNumber": "0612345678"
      ]
      ) { (message) in 
        if message["status"] == "SUCEEDED"    { }    // handle succeeded status
        else if message["status"] == "FAILED" { }    // handle failed status
      } 
    
    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
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    
    // 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: 2006 -------- */
    {
      "transactionId": "953cfefb-bc72",
      "status": "FAILED",
      "error": {
        "code": 2006,
        "label": "Core not well configured"
      }
    }
    /* -------- 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"
      }
    }
    /* -------- STATUS FAILED: 2201 -------- */
    {
      "transactionId": "953cfefb-bc72",
      "status": "FAILED",
      "error": {
        "code": 2201,
        "label": "Timeout/Polling Timeout/Command Timeout"
      }
    }
    /* -------- STATUS FAILED: 2202 -------- */
    {
      "transactionId": "953cfefb-bc72",
      "status": "FAILED",
      "error": {
        "code": 2202,
        "label": "Network problem : No internet"
      }
    }
    /* -------- STATUS FAILED: 2204 -------- */
    {
      "transactionId": "953cfefb-bc72",
      "status": "FAILED",
      "error": {
        "code": 2204,
        "label": "Server Error"
      }
    }