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.

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

  1. Prepare personal access token and target workspace ID that can access the target workspace.

  2. Query the SQL workbook list, select and record the workbook ID.

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

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\"
  }"

Parameter

Type

Required

Description

workbook_id

string

Yes

The ID of the SQL workbook.

version_id

string

Yes

Version ID in the SQL workbook.

Successful response

JSON
{
  "code": 200,
  "data": {
    "sql_content": "SELECT 1",
    "created_at": "2026-01-01T00:00:00Z",
    "updated_at": "2026-01-01T00:00:00Z"
  }
}

Field

Type

Description

code

integer

200 on success.

data

object

SQL workbook version content.

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 工作簿或版本不存在"
}

Field

Type

Description

code

integer or string

Error code or status code.

message

string

error message.

Last updated on