curl --request GET \
--url https://api.nugen.in/api/v3/documents/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nugen.in/api/v3/documents/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nugen.in/api/v3/documents/{document_id}', 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://api.nugen.in/api/v3/documents/{document_id}",
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: Bearer <token>"
],
]);
$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://api.nugen.in/api/v3/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nugen.in/api/v3/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"categories": [
"customer_support",
"documentation"
],
"completed_at": "2024-01-15T10:31:00Z",
"created_at": "2024-01-15T10:30:00Z",
"document_id": "document_01k4x9m2p7q3r5s8",
"document_name": "Customer Support Guide",
"filename": "customer_support_guide.txt",
"size": 2548736,
"status": "READY",
"type": "text/plain",
"updated_at": "2024-01-15T10:31:00Z",
"uploader": "user@example.com"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Document
Fetch a document’s details.
Args:
document_id: Document ID (path parameter)
Raises:
404: If the document is not found or doesn’t belong to the user
curl --request GET \
--url https://api.nugen.in/api/v3/documents/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nugen.in/api/v3/documents/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nugen.in/api/v3/documents/{document_id}', 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://api.nugen.in/api/v3/documents/{document_id}",
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: Bearer <token>"
],
]);
$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://api.nugen.in/api/v3/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nugen.in/api/v3/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"categories": [
"customer_support",
"documentation"
],
"completed_at": "2024-01-15T10:31:00Z",
"created_at": "2024-01-15T10:30:00Z",
"document_id": "document_01k4x9m2p7q3r5s8",
"document_name": "Customer Support Guide",
"filename": "customer_support_guide.txt",
"size": 2548736,
"status": "READY",
"type": "text/plain",
"updated_at": "2024-01-15T10:31:00Z",
"uploader": "user@example.com"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Returns the document's full record: document_id, name, filename, type, size, status, categories, uploader, and timestamps.
One document's full record: everything on its status and list rows, plus filename, type, size and uploader found nowhere else.
Unique identifier for the document
"document_01k4x9m2p7q3r5s8"
"document_01k4x9m2p7q3r5s9"
Original filename of the uploaded document
"product_catalog.docx"
"training_manual.txt"
MIME type of the document
"text/plain"
File size in bytes
x >= 02548736
1024000
512000
Current processing status of the document (PROCESSING, READY, FAILED)
PROCESSING, READY, FAILED List of category tags assigned to the document for organization and retrieval
["customer_support", "documentation"]
["products", "sales"]
["legal", "compliance"]
Email/username of the user who uploaded the document
"user@example.com"
"admin@example.com"
Display name of the document. Defaults to the document id if not set at upload.
"Customer Support Guide"
Timestamp when the document was created
Timestamp when processing completed; null while still running
Timestamp of the last status change
Completion progress, 0.0 to 100.0. Not wired up yet, always null.
Estimated time remaining in seconds. Not wired up yet, always null.
Was this page helpful?