Create a Single Scheduled Report¶
POST /api/v1/crontab_report/add
Overview¶
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
title | string | Y | Scheduled report name Allow empty: True Maximum length: 200 |
content | string | Scheduled report content Allow empty: True Maximum length: 1000 Allow empty string: True |
|
dashboardUUID | string | Y | Dashboard uuid Allow empty: False |
recipient | array | Y | Recipient information Example: [acnt_xxxx, [email protected], acnt_yyy] Allow empty: False |
variables | json | View variable information Allow empty: True |
|
timeRange | string | Y | Query time range Example: 1d Allow empty: True |
crontab | string | Crontab for scheduled tasks Example: 1 2 * * * Allow empty: True Allow empty string: True |
|
singleExecuteTime | int | Timestamp for single execution Allow empty: True |
|
extend | json | Additional information Allow empty: True |
|
timezone | string | Y | Scheduled report timezone Example: Asia/Singapore Allow empty: True |
notifyType | string | Y | Scheduled report notification type Example: email Allow empty: True Optional values: ['email', 'larkRobot', 'wechatRobot', 'HTTPRequest', 'slackIncomingWebhook', 'teamsWorkflowWebhook'] |
Supplementary Parameter Notes¶
Data notes.*
- Request parameter notes
Parameter Name | Type | Description |
---|---|---|
title | string | Scheduled report name |
content | string | Scheduled report content |
dashboardUUID | string | Scheduled report's dashboard UUID |
recipient | list | List of recipient information for the scheduled report, user account acnt_/email/notification object uuid |
variables | json | View variable information |
timeRange | string | Query time range, integer plus d/h/m format, e.g.: 3d, 15m, 2h |
crontab | string | Crontab for repeated execution of scheduled tasks |
singleExecuteTime | int | Timestamp for single execution |
extend | json | Extended information used to display interface information |
timezone | string | Timezone |
notifyType | string | Notification type |
- Extend extended field notes
| Parameter Name | Type | Description | | ----------------------- | ------ | --------------------------------------------------------------------------------------------- | --- | | shareConfig | json | Scheduled report sharing configuration | | | shareConfig.shareMethod | string | Scheduled report sharing configuration public or encipher public and encrypted default public | | shareConfig.password | string | Scheduled report sharing password encrypted sharing password |
Request Example¶
curl 'https://us1-openapi.truewatch.com/api/v1/crontab_report/add' \
-H 'Accept-Language: en' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json, text/plain, */*' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"title":"test2","content":"","dashboardUUID":"dsbd_xxxx32","recipient":["acnt_xxxx32"],"timeRange":"1d","singleExecuteTime":1698718800,"crontab":"","extend":{"cycleTimeType":"once","hour":"10","minutes":"20","dashboardInfo":{"value":"dsbd_xxxx32","label":"whytest"}},"timezone":"Asia/Singapore","notifyType":"email"}' \
--compressed
Response¶
{
"code": 200,
"content": {
"content": "",
"createAt": 1698665760,
"creator": "wsak_xxxxx",
"crontab": "",
"dashboardUUID": "dsbd_xxxx32",
"deleteAt": -1,
"executed": 0,
"extend": {
"cycleTimeType": "once",
"dashboardInfo": {
"label": "whytest",
"value": "dsbd_xxxx32"
},
"hour": "10",
"minutes": "20"
},
"id": 205,
"isLocked": 0,
"notifyType": "email",
"recipient": [
"acnt_xxxx32"
],
"singleExecuteTime": 1698718800,
"status": 0,
"timeRange": "1d",
"timezone": "Asia/Singapore",
"title": "test2",
"updateAt": 1698665760,
"updator": "wsak_xxxxx",
"uuid": "cron_xxxx32",
"variables": {},
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-F4667E68-FB26-4987-891B-F00909A2948D"
}