View SQL workbook list

Lists the SQL save records that can be read by the current access credentials. The workbook_id in each item can be used to view the version, modify the name, or delete the record.

HTTP
POST $CLOUDSIGMA_API_BASE/workbook/list

Before you call this API

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

At most 100 records are returned each time; 20 records are returned when page_size is not specified. When the next_page_token in the response is not empty, fill the value into the page_token of the next request as it is; when it is empty, it means that the last page has been reached.

Request

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

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

Request body

FieldTypeDescription
searchstringSearch by name.
page_sizeintegerNumber per page, ranging from `1` to `100`; if not passed, it is `20`.
page_tokenstringNext page token.

Successful response

data.result is the record list of saved SQL, and data.total is the total number of matches. The workbook_id in each item can be used to later view the version, modify the name, or delete the record.

JSON
{
  "code": 200,
  "data": {
    "total": 1,
    "result": [
      {
        "workbook_id": "workbook-123",
        "name": "销售分析"
      }
    ],
    "next_page_token": ""
  }
}

The response fields are as follows.

Field

Type

Description

data.total

integer

The total number of records matched by the current query.

data.result

array

Record list of saved SQL.

data.result[].workbook_id

string

ID of SQL saved record.

data.result[].name

string

The name of the saved record.

data.next_page_token

string

Next page mark; if empty, there will be no next page.

In field paths, [] denotes each item in an array. For example, items[].name is the name field of each item in the items array.

Error response

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

Follow-up operations

Save the identifier of the target item, and then View the saved SQL version content.

Last updated on