DigiLocker Session — Start Document Access
Start a DigiLocker session to begin the user consent and document access flow. Returns an authorization URL for user redirection.
curl -X POST "https://production.deepvue.tech/v1/kyc/digilocker/initiate-session" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "client-id: YOUR_API_KEY" \
-d '{
"consent": "example_string",
"purpose": "example_string",
"redirect_url": "example_string",
"doc_types": [
"aadhaar"
]
}'
import requests
import json
url = "https://production.deepvue.tech/v1/kyc/digilocker/initiate-session"
headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"client-id": "YOUR_API_KEY"
}
data = {
"consent": "example_string",
"purpose": "example_string",
"redirect_url": "example_string",
"doc_types": [
"aadhaar"
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://production.deepvue.tech/v1/kyc/digilocker/initiate-session", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"client-id": "YOUR_API_KEY"
},
body: JSON.stringify({
"consent": "example_string",
"purpose": "example_string",
"redirect_url": "example_string",
"doc_types": [
"aadhaar"
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"consent": "example_string",
"purpose": "example_string",
"redirect_url": "example_string",
"doc_types": [
"aadhaar"
]
}`)
req, err := http.NewRequest("POST", "https://production.deepvue.tech/v1/kyc/digilocker/initiate-session", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("client-id", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://production.deepvue.tech/v1/kyc/digilocker/initiate-session')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = 'YOUR_API_KEY'
request['client-id'] = 'YOUR_API_KEY'
request.body = '{
"consent": "example_string",
"purpose": "example_string",
"redirect_url": "example_string",
"doc_types": [
"aadhaar"
]
}'
response = http.request(request)
puts response.body
{
"code": 201,
"timestamp": 1738305237960,
"transaction_id": "0c8c7833678e412f9fec77dbe0494562",
"data": {
"authorization_url": "https://production.deepvue.tech/v1/kyc/digilocker/digilocker-redirect?state=0c8c7833678e412f9fec77dbe0494562"
}
}
{
"detail": "Inactive client_id"
}
{
"detail": "Not authenticated"
}
{
"detail": "Not a valid token"
}
{
"detail": [
{
"loc": [
"body",
"consent"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
{
"detail": "Internal Server Error"
}
/v1/kyc/digilocker/initiate-session
The CLIENT_SECRET provided to you. This header parameter is required for authentication purposes.
The CLIENT_ID provided to you. This header parameter is required for authentication purposes.
The media type of the request body
The consent parameter indicates whether the user has given consent for the session initiation in the Digilocker service.
The purpose parameter specifies the reason for initiating the session in the Digilocker service.
URL where the user needs to be redirected once the consent is approved.
List of ID Documents. Allowed values are 'aadhaar', 'pan', 'dl'. Only the specified document types will be displayed on the consent screen page for the user. Default value: ['aadhaar','pan','dl']
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. The CLIENT_SECRET provided to you. This header parameter is required for authentication purposes.
API Key for authentication. The CLIENT_ID provided to you. This header parameter is required for authentication purposes.
Body
The consent parameter indicates whether the user has given consent for the session initiation in the Digilocker service.
The purpose parameter specifies the reason for initiating the session in the Digilocker service.
URL where the user needs to be redirected once the consent is approved.
List of ID Documents. Allowed values are 'aadhaar', 'pan', 'dl'. Only the specified document types will be displayed on the consent screen page for the user. Default value: ['aadhaar','pan','dl']
Responses
Last updated 4 weeks ago
Built with Documentation.AI