v1

latestOpenAPI 3.0.22026-07-14225376.6 KB
Authorization API

Get Device Code

The client device calls the DigiLocker API to get the device code by providing the client_id issued to the device OEM and either the username or the mobile number of the user. DigiLocker responds with a device code and then sends an OTP on the mobile number and email address associated with the user’s account. The masked mobile number and email address is also sent in response. The device should use these values to notify the users about the mobile and email address on which the OTP has been sent.

post/oauth2/1/code

Request body

client_idstring
dl_mobileinteger

Mobile number associated with DigiLocker account of the user. The client device accepts the mobile number on the device from user and sends it in this parameter. Either the username or the mobile number must be provided.

dl_usernamestring

DigiLocker username of the user. The client device accepts the username on the device from user and sends the username in this parameter. Either the username or the mobile number must be provided.

response_typestring

The parameter must be set to device_code.

Example request

{
  "response_type": "device_code"
}

Response

successful operation

device_codestring required

The device verification code.

dl_masked_emailstring required

The masked email on which the OTP is sent.

dl_masked_mobileinteger required

The masked mobile number on which the OTP is sent.

expires_ininteger required

The duration in seconds for which the code is valid.

Example response

{
  "device_code": "74tq5miHKB",
  "dl_masked_email": "xxxxxx@gmail.com",
  "expires_in": 600
}