View SQL workbook version content¶
View the SQL content in a workbook version without executing it.
POST $CLOUDSIGMA_API_BASE/workbook/detail
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
You can first View SQL workbook version list to obtain version_id.
In the example below, $WORKBOOK_ID is the ID of the SQL saved record, and $VERSION_ID is the version ID to view.
Request¶
Replace caller-specific values in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workbook/detail" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"workbook_id\": \"$WORKBOOK_ID\",
\"version_id\": \"$VERSION_ID\"
}"
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
workbook_id | string | Required | The ID of the SQL saved record. |
version_id | string | Required | The version ID in the SQL save record. |
Successful response¶
data.sql_content is the SQL text saved by this version; created_at and updated_at are the creation and update times of this version respectively.
{
"code": 200,
"data": {
"sql_content": "SELECT 1",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
SQL content in version. |
|
string |
Creation time. |
|
string |
Update time. |
Error response¶
{
"code": 404,
"message": "SQL 工作簿或版本不存在"
}
| Field | Type | Description |
|---|---|---|
code | integer or string | Error code or status. |
message | string | Error message. |
Follow-up operations¶
When a name change is required, Update SQL workbook name. View SQL workbook list when returning to the list.