Get Document
curl --request GET \
--url https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/{session_id}/documents/{doc_type} \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}"
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}', 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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}",
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}"
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}")
.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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}")
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": 1751975529441,
"data": {
"files": [
{
"@entity": "org.quicko.drive.file",
"url": "https://in-co-sandbox-kyc-digilocker-dev.s3.ap-south-1.amazonaws.com/non-persistent/e385432b-575c-4b6f-8928-79136dbc0d4f/4b4bf7aa-f4da-47a8-9b32-895edfc03630/in.gov.uidai-ADHAR-0d5fe4d692c73e23c59a694eaaabc75a.xml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Date=20250708T115214Z&X-Amz-Expires=3600&X-Amz-Signature=8cc4b0e8eb3794601c7fdb7e85f3a6bb3a8e1842403c8aeae5c05b7af03bdadb&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
"size": 16598,
"metadata": {
"ContentType": "application/xml",
"issuer_id": "in.gov.mca",
"issuer": "Ministry of Corporate Affairs (MCA), Govt. of India",
"LastModified": "09/05/2025",
"description": "Company Master Details"
}
}
]
},
"transaction_id": "a4d43b74-0f9c-480c-9300-f011100b674b"
}{
"code": 400,
"timestamp": 1760432035872,
"message": "Consent for gstn_details not provided",
"transaction_id": "3d1d2d37-3179-4a3c-8397-2287084d1de1"
}{
"code": 503,
"timestamp": 1000000000000,
"transaction_id": "6c05f692-c32f-4de0-92b4-56684bdf16f0",
"message": "Source Unavailable"
}{
"code": 521,
"timestamp": 1760428752393,
"message": "Data not found for: 839fd8a0-d645-42e1-a904-bb43353b0139",
"transaction_id": "8be099b1-8d19-457e-b907-5b825740d9cc"
}{
"code": 523,
"timestamp": 1760431743347,
"message": "Cannot get document due to invalid session lifecycle",
"transaction_id": "031c9d24-99c4-49cb-b4ba-11e8c3630f9f"
}Fetch Document
GET
/
kyc
/
entitylocker-sdk
/
sessions
/
{session_id}
/
documents
/
{doc_type}
Get Document
curl --request GET \
--url https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/{session_id}/documents/{doc_type} \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/kyc/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}"
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}', 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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}",
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}"
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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}")
.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/entitylocker-sdk/sessions/{session_id}/documents/{doc_type}")
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": 1751975529441,
"data": {
"files": [
{
"@entity": "org.quicko.drive.file",
"url": "https://in-co-sandbox-kyc-digilocker-dev.s3.ap-south-1.amazonaws.com/non-persistent/e385432b-575c-4b6f-8928-79136dbc0d4f/4b4bf7aa-f4da-47a8-9b32-895edfc03630/in.gov.uidai-ADHAR-0d5fe4d692c73e23c59a694eaaabc75a.xml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Date=20250708T115214Z&X-Amz-Expires=3600&X-Amz-Signature=8cc4b0e8eb3794601c7fdb7e85f3a6bb3a8e1842403c8aeae5c05b7af03bdadb&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
"size": 16598,
"metadata": {
"ContentType": "application/xml",
"issuer_id": "in.gov.mca",
"issuer": "Ministry of Corporate Affairs (MCA), Govt. of India",
"LastModified": "09/05/2025",
"description": "Company Master Details"
}
}
]
},
"transaction_id": "a4d43b74-0f9c-480c-9300-f011100b674b"
}{
"code": 400,
"timestamp": 1760432035872,
"message": "Consent for gstn_details not provided",
"transaction_id": "3d1d2d37-3179-4a3c-8397-2287084d1de1"
}{
"code": 503,
"timestamp": 1000000000000,
"transaction_id": "6c05f692-c32f-4de0-92b4-56684bdf16f0",
"message": "Source Unavailable"
}{
"code": 521,
"timestamp": 1760428752393,
"message": "Data not found for: 839fd8a0-d645-42e1-a904-bb43353b0139",
"transaction_id": "8be099b1-8d19-457e-b907-5b825740d9cc"
}{
"code": 523,
"timestamp": 1760431743347,
"message": "Cannot get document due to invalid session lifecycle",
"transaction_id": "031c9d24-99c4-49cb-b4ba-11e8c3630f9f"
}Sample Responses
See sample XML response returned by EntityLocker for GSTN Details and Udyam Certificate.
Headers
JWT access token. For token-generation steps, refer to the Quickstart Guide.
API key used to identify and authenticate the client.
Path Parameters
Session identifier generated during EntityLocker SDK Create Session API .
Document type identifying which EntityLocker document to retrieve. Must match one of the consented doc_types values.
Available options:
company_master_details, gstn_details, udhyam_certificate Was this page helpful?
āI