curl --request POST \
--url https://api.privue.ai/digilocker/v1/create-url.1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signup": false,
"success_redirect_url": "https://app.example.com/kyc/done",
"success_redirect_time": 5,
"failure_redirect_url": "https://app.example.com/kyc/declined",
"failure_redirect_time": 5,
"doc_type": [
"ADHAR",
"PANCR"
],
"purpose": "kyc",
"get_scope": true,
"internal_id": "applicant-1042",
"callback_url": "https://app.example.com/digilocker/callback",
"get_e_aadhaar_pdf": true
}
'import requests
url = "https://api.privue.ai/digilocker/v1/create-url.1"
payload = {
"signup": False,
"success_redirect_url": "https://app.example.com/kyc/done",
"success_redirect_time": 5,
"failure_redirect_url": "https://app.example.com/kyc/declined",
"failure_redirect_time": 5,
"doc_type": ["ADHAR", "PANCR"],
"purpose": "kyc",
"get_scope": True,
"internal_id": "applicant-1042",
"callback_url": "https://app.example.com/digilocker/callback",
"get_e_aadhaar_pdf": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signup: false,
success_redirect_url: 'https://app.example.com/kyc/done',
success_redirect_time: 5,
failure_redirect_url: 'https://app.example.com/kyc/declined',
failure_redirect_time: 5,
doc_type: ['ADHAR', 'PANCR'],
purpose: 'kyc',
get_scope: true,
internal_id: 'applicant-1042',
callback_url: 'https://app.example.com/digilocker/callback',
get_e_aadhaar_pdf: true
})
};
fetch('https://api.privue.ai/digilocker/v1/create-url.1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"details": {
"url": "https://api.digitallocker.gov.in/public/oauth2/1/authorize?client_id=AB12CD34&code_challenge=2R4H2pVG-SmhvTDn0xQlLcPWqAvp15XUufUBbQ0Sd2I&code_challenge_method=S256&response_type=code&state=652523835a9f9000112b1ee6",
"request_id": "652523835a9f9000112b1ee6"
}
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}DigiLocker consent link
Create a link that takes a person to DigiLocker to consent to sharing their documents.
Send the person to details.url. Once they have given their consent, details.request_id reads their account through the other DigiLocker endpoints, and where callback_url was given the result is POSTed there as well. A consent the person has not completed has nothing to read, so read once they reach success_redirect_url or the result reaches callback_url.
Only you can read through a consent you created, and for 30 days after you created it: a request_id from a link you did not create, or from one created longer ago, answers 404.
curl --request POST \
--url https://api.privue.ai/digilocker/v1/create-url.1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signup": false,
"success_redirect_url": "https://app.example.com/kyc/done",
"success_redirect_time": 5,
"failure_redirect_url": "https://app.example.com/kyc/declined",
"failure_redirect_time": 5,
"doc_type": [
"ADHAR",
"PANCR"
],
"purpose": "kyc",
"get_scope": true,
"internal_id": "applicant-1042",
"callback_url": "https://app.example.com/digilocker/callback",
"get_e_aadhaar_pdf": true
}
'import requests
url = "https://api.privue.ai/digilocker/v1/create-url.1"
payload = {
"signup": False,
"success_redirect_url": "https://app.example.com/kyc/done",
"success_redirect_time": 5,
"failure_redirect_url": "https://app.example.com/kyc/declined",
"failure_redirect_time": 5,
"doc_type": ["ADHAR", "PANCR"],
"purpose": "kyc",
"get_scope": True,
"internal_id": "applicant-1042",
"callback_url": "https://app.example.com/digilocker/callback",
"get_e_aadhaar_pdf": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signup: false,
success_redirect_url: 'https://app.example.com/kyc/done',
success_redirect_time: 5,
failure_redirect_url: 'https://app.example.com/kyc/declined',
failure_redirect_time: 5,
doc_type: ['ADHAR', 'PANCR'],
purpose: 'kyc',
get_scope: true,
internal_id: 'applicant-1042',
callback_url: 'https://app.example.com/digilocker/callback',
get_e_aadhaar_pdf: true
})
};
fetch('https://api.privue.ai/digilocker/v1/create-url.1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"details": {
"url": "https://api.digitallocker.gov.in/public/oauth2/1/authorize?client_id=AB12CD34&code_challenge=2R4H2pVG-SmhvTDn0xQlLcPWqAvp15XUufUBbQ0Sd2I&code_challenge_method=S256&response_type=code&state=652523835a9f9000112b1ee6",
"request_id": "652523835a9f9000112b1ee6"
}
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}{
"code": 123,
"timestamp": 123,
"message": "<string>"
}Authorizations
Your API key, sent as Authorization: Bearer <your-key>.
Body
How the DigiLocker consent is presented, where the person and the result go, and what it returns.
Every field is optional.
Whether a person without a DigiLocker account may create one during the consent. An account created this way has to be linked to its Aadhaar number in DigiLocker before any document can be read from it.
Where the person is sent after giving consent
1 - 2083Seconds before the person is sent to success_redirect_url. Defaults to 10
x >= 0Where the person is sent when the consent is not given
1 - 2083Seconds before the person is sent to failure_redirect_url. Defaults to 10
x >= 0The DigiLocker document types the person is asked to share, and the only ones the consent screen shows. Defaults to ["PANCR", "ADHAR", "DRVLC"]: PAN, Aadhaar and driving licence.
11["ADHAR"]
Why the person is asked for their consent
kyc, verification, compliance, availing_services, educational Whether the callback reports what the person gave access to
Your own reference for this consent, carried back on the callback
Whether the person may sign in to DigiLocker on their phone without a PIN
Where the consent's result is sent, as a JSON POST, once the person has given it. Must be an https URL.
1 - 2083A password the files read through this consent are protected with
Whether files come back as base64 in place of a download link
Whether the e-Aadhaar PDF comes back
Whether the e-Aadhaar JPEG comes back
Response
Successful Response
The DigiLocker link to send the person to, and the id their consent is read by.
The consent link and its request id
Show child attributes
Show child attributes
