Retrieve a document
GEThttps://api.vectara.io/v2/corpora/:corpus_key/documents/:document_id
Retrieve the content and metadata of a specific document, identified by its
unique document_id
from a specific corpus.
Request
Path Parameters
Possible values: <= 50 characters
, Value must match regular expression [a-zA-Z0-9_\=\-]+$
The unique key identifying the corpus containing the document to retrieve.
The document ID of the document to retrieve.
This document_id
must be percent encoded.
Header Parameters
Possible values: >= 1
The API will make a best effort to complete the request in the specified seconds or time out.
Possible values: >= 1
The API will make a best effort to complete the request in the specified milliseconds or time out.
Responses
- 200
- 403
- 404
Successfully retrieved the document.
- application/json
- Schema
- Example (from schema)
Schema
The document ID.
metadata object
tables object[]
parts object[]
storage_usage object
extraction_usage object
{
"id": "my-doc-id",
"metadata": {},
"tables": [
{
"id": "table_1",
"title": "string",
"data": {
"headers": [
[
{
"text_value": "string",
"int_value": 0,
"float_value": 0,
"bool_value": true,
"colspan": 0,
"rowspan": 0
}
]
],
"rows": [
[
{
"text_value": "string",
"int_value": 0,
"float_value": 0,
"bool_value": true,
"colspan": 0,
"rowspan": 0
}
]
]
},
"description": "string"
}
],
"parts": [
{
"text": "I'm a nice document part.",
"metadata": {
"nice_rank": 9000
},
"context": "string",
"custom_dimensions": {}
}
],
"storage_usage": {
"bytes_used": 0,
"metadata_bytes_used": 0
},
"extraction_usage": {
"table_extraction_used": 0
}
}
Permissions do not allow retrieving a document from the corpus.
- application/json
- Schema
- Example (from schema)
Schema
The messages describing why the error occurred.
The ID of the request that can be used to help Vectara support debug what went wrong.
{
"messages": [
"Internal server error."
],
"request_id": "string"
}
Corpus or document not found.
- application/json
- Schema
- Example (from schema)
Schema
The ID cannot be found.
ID of the request that can be used to help Vectara support debug what went wrong.
{
"id": "string",
"messages": [
"string"
],
"request_id": "string"
}
Authorization: x-api-key
name: x-api-keytype: apiKeyin: header
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X GET 'https://api.vectara.io/v2/corpora/:corpus_key/documents/:document_id' \
-H 'Accept: application/json' \
-H 'x-api-key: <API_KEY_VALUE>'