Create SQL workbook

Create a SQL workbook that holds SQL content and its versions. After success, save the returned workbook_id for creating and managing versions.

HTTP
POST $CLOUDSIGMA_API_BASE/workbook/create

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

$WORKBOOK_NAME in the example below is the name of the saved record.

Request

Replace caller-specific values in the example with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workbook/create" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{
    \"name\": \"$WORKBOOK_NAME\"
  }"

Request body

ParameterTypeRequiredDescription
namestringRequiredThe name of the saved record.

Successful response

data.workbook_id is the ID of the newly saved record, and data.name is the record name. After saving workbook_id, first View SQL saved record version to obtain the version ID; when you need to add an editable version, then Create SQL draft version.

JSON
{
  "code": 200,
  "data": {
    "workbook_id": "workbook-123",
    "name": "销售分析"
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

200 on success.

data.workbook_id

string

Create a new SQL ID to save the record.

data.name

string

The name of the saved record.

Error response

JSON
{
  "code": 400,
  "message": "请求参数无效"
}
FieldTypeDescription
codeinteger or stringError code or status.
messagestringError message.

Follow-up operations

Logging data.workbook_id. First View the version of the SQL saved record to obtain version_id, and then use the two IDs to View the version content of the saved SQL.

Last updated on