Preview source original file

Preview the original file associated with the knowledge base as a binary stream.

HTTP
GET $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/sources/file/{file_id}/preview

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare the personal access token, workspace ID, knowledge base ID, and source original file ID that have read permissions for the target knowledge base.

Request parameters

Shell
curl -L "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/sources/file/$FILE_ID/preview" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -o preview.bin

file_id Fill in the original source document ID. You cannot use row_id returned by query knowledge base data source list.

Field

Type

Required

Description

model_id

integer

Yes

knowledge base ID.

file_id

string

Yes

Source original file ID to preview.

Successful response

Text
HTTP 200 binary stream

Returns 200 and a file binary stream on success, without using a JSON response structure.

Field

Type

Description

Content-Type

HTTP Header

File MIME type. When not recognized, it is application/octet-stream.

Content-Disposition

HTTP Header

Returns an inline preview of the filename when available.

Office files may be converted back to PDF. ZIP source files may be returned with Markdown content within them. So the response should be processed based on the actual Content-Type.

Last updated on