Get User Profile
curl --request GET \
--url https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile"
headers = {
"Authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile")
.header("Authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1744874068219,
"data": {
"id": "b5522c8f-2321-577b-8e73-ae1366d9c591",
"@entity": "in.co.sandbox.kyc.digilocker.user.profile",
"date_of_birth": 1071145000000,
"mobile": "9825013730",
"name": "Kaival Mehta",
"gender": "male",
"eaadhaar": true
},
"transaction_id": "0793c784-fcaa-44d9-b8fc-f6a382a67f70"
}Get User Profile
Gets the User Profile Details from Digilocker like Name, Date of Birth, Gender, Mobile Number, Email Id.
GET
/
kyc
/
digilocker
/
sessions
/
{session_id}
/
user
/
profile
Get User Profile
curl --request GET \
--url https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile"
headers = {
"Authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile")
.header("Authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.sandbox.co.in/kyc/digilocker/sessions/{session_id}/user/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1744874068219,
"data": {
"id": "b5522c8f-2321-577b-8e73-ae1366d9c591",
"@entity": "in.co.sandbox.kyc.digilocker.user.profile",
"date_of_birth": 1071145000000,
"mobile": "9825013730",
"name": "Kaival Mehta",
"gender": "male",
"eaadhaar": true
},
"transaction_id": "0793c784-fcaa-44d9-b8fc-f6a382a67f70"
}Run in Postman
User profile details can only be fetched if the user has provided consent for it.
Headers
JWT access token. For token-generation steps, refer to the Quickstart Guide.
Path Parameters
Session identifier generated during DigiLocker Initiate Session API .