Query document details¶
Query the current snapshot and segment content of the source document for verification before editing segments.
GET $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/sources/{source_row_id}/document
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. First query the knowledge base data source list to obtain the source record ID. Prepare a personal access token and target workspace ID that can access the target workspace.
Request parameters¶
curl "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/sources/$SOURCE_ROW_ID/document?page_size=20" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Read next page
curl --get "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/sources/$SOURCE_ROW_ID/document" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "page_size=20" \
--data-urlencode "cursor=$NEXT_CURSOR"
When editing a segment, use the data.etag returned by this interface to check whether the document has changed during modification.
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
knowledge base ID. |
|
string |
Yes |
Source record ID. |
Query parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
The number of segments per page must be a positive integer. The default value is 20. When it exceeds 100, it is processed as 100. |
|
string |
No |
|
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"source": {
"row_id": "src_01",
"model_id": 401,
"source_type": "file",
"ingest_status": "ready"
},
"preview": {
"available": true
},
"file_info": {
"tags": ["product"],
"enabled": true,
"expires_at": null,
"expired": false,
"effective_enabled": true,
"force_enabled_after_expiry": false
},
"segment_status": {
"available": true,
"total": 1
},
"etag": "<DOCUMENT_ETAG>",
"segments": [
{
"segment_id": "seg_01",
"level": "chunk",
"content": "产品说明",
"word_count": 4,
"recall_count": 0,
"enabled": true
}
]
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
response data. |
|
object |
Source records. |
|
object |
Source content preview. |
|
object |
File labels, expiration and activation information. |
|
object |
Current segment availability status and quantity. |
|
string |
The ETag of the current snapshot. Return when there is a value, fill in |
|
array of object |
This page segment of the current snapshot. |
|
string |
Source record ID. |
|
string |
Source ID. Returns if not empty. |
|
string |
Source type. |
|
integer |
Belonging knowledge base ID. |
|
string |
Source resource ID. |
|
string |
Original resource ID. Returned if there is a value. |
|
string |
Resource ID on the knowledge base side. Returned if there is a value. |
|
string |
Original file ID. Returned if there is a value. |
|
string |
knowledge base file ID. Returned if there is a value. |
|
integer |
Original table ID. Returned if there is a value. |
|
integer |
knowledge base table ID. Returned if there is a value. |
|
string or null |
Display name. |
|
array of string |
Source path. |
|
string |
Original source path. Returned if there is a value. |
|
string or null |
Database name. |
|
string or null |
Table name. |
|
integer or null |
File size. |
|
integer or null |
Number of table rows. |
|
string or null |
Processing status. |
|
boolean or null |
The enabled status of the configuration. |
|
integer or null |
Expiration time. |
|
boolean |
Has it expired? |
|
boolean |
Current actual effective status. |
|
boolean |
Whether to force activation after expiration. |
|
array of string |
Source tag. Returns if not empty. |
|
string |
Creator ID. Returned if there is a value. |
|
string |
Last updated by ID. Returned if there is a value. |
|
integer or null |
Last updated time. |
|
string or null |
Handle errors. |
|
string |
Management status. Returns if not empty. |
|
string |
Historical source markers. Returned if there is a value. |
|
boolean |
Whether preview content is available. |
|
string |
Preview content. Returned if there is a value. |
|
string |
Reason why preview is unavailable. Returned if there is a value. |
|
array of string or null |
File label. When there is no label, it is |
|
integer or null |
Expiration time. |
|
boolean or null |
The enabled status of the configuration. |
|
boolean |
Has it expired? |
|
boolean |
Current actual effective status. |
|
boolean |
Whether to force activation after expiration. |
|
boolean |
Whether the segment is available. |
|
string |
Reason for unavailability. Returned if there is a value. |
|
integer |
Number of segments. |
|
string |
Next page cursor. Return when there are subsequent segments. |
|
string |
Segment ID. |
|
integer |
Starting time or location. Returned if there is a value. |
|
integer |
End time or location. Returned if there is a value. |
|
string |
Segment level. |
|
integer |
Segment number. Returned if there is a value. |
|
string |
Block ID. Returned if there is a value. |
|
string |
Segmented content. Returned if there is a value. |
|
string |
OCR text. Returned if there is a value. |
|
string |
Image description. Returned if there is a value. |
|
string |
Image file ID. Returned if there is a value. |
|
string |
Page image file ID. Returned if there is a value. |
|
integer |
Number of Unicode characters combined for text, OCR text, and image descriptions, including delimiting newlines. |
|
integer |
Number of recalls. |
|
boolean |
Whether segmentation is enabled. |
|
object |
Information about the source volume. Returned when |
Error response¶
{
"code": "ErrNotFound",
"msg": "Not Found"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |