View SQL workbook version list¶
List all versions of a SQL workbook. Once you select a version, you can review the content, revise the draft, or finalize the version.
POST $CLOUDSIGMA_API_BASE/workbook/version/list
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.
Prepare personal access token and target workspace ID that can access the target workspace.
Query the SQL workbook list, select and record the workbook ID.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $WORKBOOK_ID in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workbook/version/list" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"workbook_id\": \"$WORKBOOK_ID\",
\"page_size\": 20
}"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the SQL workbook. |
|
integer |
No |
Quantity per page, range 1 to 100. When not transmitted, it is 20. |
|
string |
No |
Next page mark. |
Pagination
Token binding list type, workspace, workbook and search criteria after removing leading and trailing whitespace. Subsequent requests must maintain the same scope and pass the token unchanged. The page size can be modified within 1–100, omitted or null defaults to 20. Page by creation time and ID in double descending order. Ends when the next page token is empty.
total is the number of all records that meet the filtering conditions. If there is no result, [] is returned. The token is unsigned and cannot replace authorization credentials.
Successful response¶
{
"code": 200,
"data": {
"total": 21,
"result": [
{
"id": "wbv_019a15d7-4c00-7000-8000-000000000002",
"name": "v1",
"status": "draft"
}
],
"next_page_token": "eyJvZmZzZXQiOjIwfQ"
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
200 on success. |
|
object |
List of SQL workbook versions. |
|
integer |
The total number of versions of the current SQL workbook. |
|
array of object |
Version list. |
|
string |
Next page mark. When empty there is no next page. |
|
string |
Version ID. |
|
string |
Version name. |
|
string |
Version status: draft means an editable draft. finalize means finalized and read-only. |
Error response¶
{
"code": 404,
"message": "SQL 工作簿不存在"
}
Field |
Type |
Description |
|---|---|---|
|
integer or string |
Error code or status code. |
|
string |
error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |