View SQL workbook version content

View the SQL content in a workbook version without executing it.

HTTP
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.

Shell
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

ParameterTypeRequiredDescription
workbook_idstringRequiredThe ID of the SQL saved record.
version_idstringRequiredThe 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.

JSON
{
  "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

data.sql_content

string

SQL content in version.

data.created_at

string

Creation time.

data.updated_at

string

Update time.

Error response

JSON
{
  "code": 404,
  "message": "SQL 工作簿或版本不存在"
}
FieldTypeDescription
codeinteger or stringError code or status.
messagestringError message.

Follow-up operations

When a name change is required, Update SQL workbook name. View SQL workbook list when returning to the list.

Last updated on