Skip to content

Create



POST /api/v1/notice/date/add

Overview

Creates a custom notification date set for reference by Alert Policies.

Before You Call and Usage Steps

Submit name and optional noticeDates to create a date set. Omitting the array or passing [] creates an empty set; if you need actual notifications, prepare valid business dates first. Each configuration holds at most 366 entries; duplicate dates are saved as-is and count toward the limit. The server only validates the YYYY/MM/DD text form; non-existent dates such as 2026/02/30 may also be saved, so the client must verify against the real calendar itself. This resource stores only date sets and does not include the start time of day, duration, or time zone. To use it, reference this resource's UUID in the Alert Policy alertOpt.alertTarget[].customDateUUIDs, and set customStartTime/customDuration together; see the Alert Policy parameters page for specific rules. Alert execution time zone reading currently has known limitations; verify the actual time zone according to the Alert Policy page description.

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 fill in: Obtain an OpenAPI Key with the required permissions from API Key management in the target Workspace.

Body Request Parameters

Parameter Type Required Description
noticeDates[*] string A single date string, YYYY/MM/DD. The server only checks the format regex and does not fully validate leap years, days in month, and so on; a successful save does not prove the date is actually valid.
Example: 2026/11/20
How to obtain or fill in: Generate a four-digit year/two-digit month/two-digit day from the business calendar, for example 2026/11/20. The client must confirm real calendar validity.
name string Y Required name; the declaration allows up to 256 characters. The current storage field capacity is shorter, so using no more than 64 characters is recommended to reduce save failures.
Allow null: False
Maximum length: 256
Example: 生产维护日
How to obtain or fill in: Check existing names in this Workspace from the custom notification date list, then name it yourself.
noticeDates array Optional full date string array, at most 366 entries (duplicates also count). Omitting it on create saves []; omitting it or passing [] on modify clears the original date set.
Allow null: False
Example: ["2026/11/20", "2026/11/27"]
How to obtain or fill in: Select real dates according to your maintenance/notification calendar and fill them in as YYYY/MM/DD strings; no timestamp conversion is needed.

Additional Parameter Notes

The date configuration does not specify a time zone, start time, or duration in seconds; these are controlled by the Alert Policy action that references it. A successful save does not send a notification immediately. If a request fails, first query whether it was already saved, then decide whether to retry.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/notice/date/add' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产维护日","noticeDates":["2026/11/20","2026/11/27"]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.id integer or null Record number; the create response may be null when constructed before saving; operations use uuid.
content.uuid string Date configuration UUID, referenced by the Alert Policy customDateUUIDs.
content.workspaceUUID string UUID of the Workspace it belongs to.
content.name string Configuration name.
content.dates array<string> Saved date array; the request field name is noticeDates, and the response field name is dates.
content.dates[] string A single YYYY/MM/DD date string.
content.status integer Record status: 0 normal, 3 deleted.
content.creator string Creator identity.
content.updator string Most recent updater identity; an empty string if not yet updated.
content.createAt integer Creation time, Unix seconds.
content.updateAt integer Update time, Unix seconds; -1 if not yet updated.
content.deleteAt integer Deletion time, Unix seconds; -1 if not deleted.
content.declaration object or null Workspace common declaration.
{
  "code": 200,
  "content": {
    "id": null,
    "uuid": "ndate_example",
    "workspaceUUID": "wksp_example",
    "name": "生产维护日",
    "dates": [
      "2026/11/20",
      "2026/11/27"
    ],
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785430800,
    "updateAt": -1,
    "deleteAt": -1,
    "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 A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Some json file format error Submit a single JSON object.
400 ft.NoticeDateNameRepeat An undeleted date configuration with the same name exists in the current Workspace Custom date configuration name duplicated Choose another name; after a timeout, first check whether it has already been created.
400 ft.InvalidNoticeDate A date string in noticeDates does not conform to the YYYY/MM/DD format Invalid date format Use a four-digit year, two-digit month/day, and forward slashes, and confirm calendar validity yourself.
406 ft.CountExceedLimit The noticeDates array exceeds 366 entries {} count exceeds the {} maximum limit Keep each configuration within 366 entries; remove unnecessary duplicate dates first.
500 ft.InternalServerError A date array element is not a string, or an internal failure occurs during saving/caching processing, etc. Internal error Fix the type and name length according to the parameter table; check the currently saved configuration first, then decide whether to retry, and provide the traceId if the failure persists.

Feedback

Is this page helpful?