This API initializes authentication via mobile id and provides a token to use in other requests.
Endpoint
Path (Locale: LT)
/mobile/login.json
Path (Locale: EN)
/en/mobile/login.json
Method
POST
Request Body Schema
application/json
Request body parameter description
Key
Requirement
Type
Description
access_token
Mandatory
String
API Access Token
phone
Mandatory
String
Mobile phone number for which authentication is being initialized
code
Mandatory
String
Personal code related to the phone number
language
Optional
String
Language for messages displayed on the phone screen (default: LIT, other: ENG, RUS, EST)
message
Optional
String
Message to be displayed on the phone screen.
message_format
Optional
String
Format of the message which is displayed on the phone screen. Possible values: GSM-7 (default), UCS-2. Max characters count for GSM-7 and UCS-2 is 40 and 20 characters respectively.
peps
Optional
Boolean
Whether to check PEPs information, default is false
sanctions
Optional
Boolean
Whether to check sanctions information, default is false
Response body parameter description
Successful response
Key
Type
Description
status
String
Status of the request, ok in this case
certificate
Object
Certificate information of the provided phone number
code
String
Personal code provided in hte request
token
String
Unique token to be used in future request
control_code
String
Verification code
Failed response
Key
Type
Description
status
String
Status of the request, error in this case
message
String
Brief message about what is wrong
error_code
Integer
Unique code for the error. Error codes are listed here
/**
* The token in response ($initAuthResArray['token'] in this example),
* might need to be saved for future purposes.
*/
$initAuthReq = (new MobileidInitAuthRequestBuilder)
->withPhone('+37269000366')
->withCode('60001017705')
->withLanguage('ENG')
->withMessage('Dummy')
->withMessageFormat('GSM-7')
->withPeps(true)
->withsanctions(true)
->createRequest();
$initAuthRes = $client->postRequest($initAuthReq);
$initAuthResArray = $initAuthRes->toArray();
var_dump($initAuthResArray);