getChunk

View as MarkdownOpen in Claude

Retrieve a specific chunk from a document.

Path parameters

documentIdstringRequiredformat: "uuid"
Unique ID of the parent Document.
chunkIdstringRequiredformat: "uuid"
Unique ID of a Chunk.

Response

idstringRequiredformat: "uuid"
Unique ID of the chunk.
datasphere_document_idstringRequiredformat: "uuid"
Unique ID of the chunk's datasphere document.
project_idstringRequiredformat: "uuid"
Unique ID of the project.
statusenumRequired
Status of the chunk.
Allowed values:
tagslist of stringsRequired
The tags of the document associated with the chunk.
contentstringRequired
Content of the chunk.
created_atdatetimeRequired
Chunk Creation Date.
updated_atdatetimeRequired
Chunk Update Date.

Response Example

Response
1{
2 "id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
3 "datasphere_document_id": "acaa5c49-be5e-4477-bce0-48f4b23b7720",
4 "project_id": "d369a402-7b43-4512-8735-9d5e1f387814",
5 "status": "completed",
6 "tags": [
7 "sports",
8 "football",
9 "game"
10 ],
11 "content": "This is the content from the original document that was chunked.",
12 "created_at": "2024-05-06T12:20-12Z",
13 "updated_at": "2024-05-06T12:20-12Z"
14}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9const chunk = await client.datasphere.documents.getChunk("document-id", "chunk-id");
10console.log(chunk.text);