Update data dashboard¶
Update the name, description, and data source of the specified data dashboard.
PATCH https://api.moi.matrixorigin.cn/v5/data-dashboards/{dashboard_id}
Preparation before calling¶
Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$DASHBOARD_ID:dashboard_idto use, specifying the target resource via the request path.
Request body¶
Replace caller-specific values in the example with actual values.
namestringRequired- Data dashboard name.
descriptionstring- Data dashboard description; omission saves an empty string.
sourcesarrayRequired- List of data sources.
sources[].table_idintegerRequired- Data source table ID.
Request example
curl -X PATCH "https://api.moi.matrixorigin.cn/v5/data-dashboards/$DASHBOARD_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "销售概览",
"description": "更新后的说明",
"sources": [{"table_id": 1001}]
}'
Successful response¶
When the update is successful, the data.updated in the response is true.
{
"code": "OK",
"msg": "OK",
"data": {"updated": true}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
boolean |
Whether it has been updated. |
Error response¶
This example corresponds to HTTP 400.
codestring- Error code, such as ErrParamInvalid or ErrDataDashboardNotFound.
msgstring- HTTP status text, such as Bad Request or Not Found.
{
"code": "ErrParamInvalid",
"msg": "Bad Request"
}
Data sources still referenced by charts¶
Removing a referenced source returns HTTP 409 with a separate error structure.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Localized error message. |
|
string |
|
|
string |
|
|
string |
Request ID, returned when nonempty. |
|
array of object |
Referenced tables. |
|
integer |
Table ID. |
|
string |
Database name. |
|
string |
Table name. |
|
array of object |
Charts referencing the table. |
|
string |
Chart ID. |
|
string |
Chart name. |