Create¶
POST /api/v1/dashboard/carousel/add
Overview¶
Creates a dashboard carousel configuration in the order provided.
Before You Call and Usage Steps¶
First use Dashboard List to confirm the dashboard UUIDs you need. All three Body fields are required. The server stores the UUID order and cleans up invalid references only when reading. After creation, save content.uuid and use the same calling identity for subsequent maintenance.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| dashboardUUIDs | array | Y | Non-empty array of dashboard UUIDs. Creation and modification save the order passed in; deleted references or references not in the current workspace are cleaned up when reading. Allow null: False Example: ["dsbd_example"]How to obtain or enter: Get values from content.data[].uuid in the Dashboard List response and enter them in the desired carousel order. |
| name | string | Y | Carousel name, up to 256 characters. Allow null: False Maximum length: 256 Example: 生产巡检轮播How to obtain or enter: Enter a carousel name that the current calling identity has not used in this workspace. |
| intervalTime | string | Y | Playback interval string, required for both creation and modification. Allow null: False Example: 30sHow to obtain or enter: Enter a string recognized by the frontend for the desired playback interval, for example 30s. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/dashboard/carousel/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"dashboardUUIDs":["dsbd_example"],"name":"生产巡检轮播","intervalTime":"30s"}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.id | integer | Internal ID of the carousel record. |
| content.uuid | string | Carousel configuration UUID, used for details, modification, and deletion. |
| content.accountUUID | string | ID of the calling identity that owns the carousel. |
| content.workspaceUUID | string | UUID of the workspace that owns the carousel. |
| content.name | string | Carousel name. |
| content.intervalTime | string | Saved carousel interval string. |
| content.dashboardUUIDs | array<string> |
Saved dashboard UUIDs, arranged in carousel order. |
| content.status | integer | Record status. |
| content.createAt | number | Creation time, in Unix seconds. |
| content.updateAt | number | Most recent update time, in Unix seconds. -1 if never updated. |
| content.deleteAt | number | Deletion time, in Unix seconds. -1 if not deleted. |
| content.creator | string | Creator identity ID. |
| content.updator | string | Identity ID of the most recent updater; an empty string if never updated. |
| content.declaration | object or null | Public declaration for the workspace. |
{
"code": 200,
"content": {
"id": 10,
"uuid": "csel_example",
"accountUUID": "wsak_example",
"workspaceUUID": "wksp_example",
"name": "生产巡检轮播",
"intervalTime": "30s",
"dashboardUUIDs": [
"dsbd_example"
],
"status": 0,
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"creator": "wsak_example",
"updator": "",
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field missing, or field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Request JSON syntax is invalid | Request JSON format error | Fix the JSON according to content.reason, line, and column. |
| 406 | ft.MissingParameters | Carousel name, dashboard list, or interval is empty | Missing parameters | Use a non-empty name, non-empty UUID array, and non-empty interval string. |
| 400 | ft.DashboardCarouselNameRepeat | The current identity already has a carousel with the same name, or a configuration with the same name is being created or modified | This carousel name already exists | Check existing configurations. If a configuration with the same name already exists, rename it or operate on it directly; if same-name operations are concurrent, wait for the previous one to complete and try again. |