View SQL workbook version content¶
View the SQL content saved in the specified version of a SQL workbook, but the SQL will not be executed.
POST $CLOUDSIGMA_API_BASE/workbook/detail
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 personal access token and target workspace ID that can access the target workspace.
Query the SQL workbook list, select and record the workbook ID.
Query the SQL workbook version list, select and record the version ID.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $WORKBOOK_ID, $VERSION_ID 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\"
}"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the SQL workbook. |
|
string |
Yes |
Version ID in the SQL workbook. |
Successful response¶
{
"code": 200,
"data": {
"sql_content": "SELECT 1",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
200 on success. |
|
object |
SQL workbook version content. |
|
string |
SQL content in version. |
|
string |
Creation time. |
|
string |
Update time. |
Error response¶
{
"code": 404,
"message": "SQL 工作簿或版本不存在"
}
Field |
Type |
Description |
|---|---|---|
|
integer or string |
Error code or status code. |
|
string |
error message. |