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.
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.
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
| Field | Type | Description |
|---|---|---|
search | string | Search by name. |
page_size | integer | Number per page, ranging from `1` to `100`; if not passed, it is `20`. |
page_token | string | Next 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.
{
"code": 200,
"data": {
"total": 1,
"result": [
{
"workbook_id": "workbook-123",
"name": "销售分析"
}
],
"next_page_token": ""
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
The total number of records matched by the current query. |
|
array |
Record list of saved SQL. |
|
string |
ID of SQL saved record. |
|
string |
The name of the saved record. |
|
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¶
{
"code": 400,
"message": "请求参数无效"
}
| Field | Type | Description |
|---|---|---|
code | integer or string | Error code or status. |
message | string | Error message. |
Follow-up operations¶
Save the identifier of the target item, and then View the saved SQL version content.