Mobile SDK

iOS or Android

API Reference - pims.authentication.user-login

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:
  • BasicAuthentication
Security: Authentication is not required.
Operation:

This api allows to login. It will prompt an external user agent (web view).

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

Name of the action to perform, in this case login.

String

login

login true
local

Define the language to use in the external user agent (web view).

string

en false
context

Context. Only for Android.

context

n/a

context true
Output Data
No outputted data
Error
Error Code Error Label
2001

Facade not initialized

2101

Missing [PARAMETER] parameter

2102

Invalid [PARAMETER] parameter

2368

WebView canceled

Code Example
1
2
3
4
5
6
7
8
9
10
11
pims.set("pims.authentication.user",
  mapOf( /* parameters */  
    Pair("action", "login"),
    Pair("local", "en"),
    Pair("", "")
  ) 
) { 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.set(api: "pims.authentication.user",
  parameters: [  
  "action": "login",
  "local": "en",
  "": ""
  ]
  ) { (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
// 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"
  }
}
/* -------- STATUS FAILED: 2368 -------- */
{
  "transactionId": "953cfefb-bc72",
  "status": "FAILED",
  "error": {
    "code": 2368,
    "label": "WebView canceled"
  }
}