Skip to content

Create 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
Max length: 200
content string Scheduled report content
Allow empty: True
Max length: 1000
Allow empty string: True
dashboardUUID string Y Dashboard uuid
Allow empty: False
recipient array Y Recipient information
Example: [acnt_xxxx, xxx@guance.com, acnt_yyy]
Allow empty: False
variables json View variables 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 Timezone for scheduled report
Example: Asia/Shanghai
Allow empty: True
notifyType string Y Notification type for scheduled report
Example: email
Allow empty: True
Optional values: ['email', 'dingTalkRobot', 'wechatRobot', 'feishuRobot', 'HTTPRequest', 'slackIncomingWebhook', 'teamsWorkflowWebhook']

Parameter Additional Explanation

Data Explanation.*

  • Request Parameter Explanation
Parameter Name type Description
title string Scheduled report name
content string Scheduled report content
dashboardUUID string Dashboard UUID for scheduled report
recipient list List of recipient information for scheduled report, user account/email/notification object UUID
variables json View variables information
timeRange string Query time range, integer plus d/h/m format, example: 3d, 15m, 2h
crontab string Crontab for repeated scheduled tasks
singleExecuteTime int Timestamp for single execution
extend json Extended information, used for front-end interface display information
timezone string Timezone
notifyType string Notification type
  • extend Field Explanation
Parameter Name type Description
shareConfig json Scheduled report sharing configuration
shareConfig.shareMethod string Scheduled report sharing configuration, public or encipher, public and encrypted, default is public
shareConfig.password string Scheduled report sharing password, encrypted sharing password

Request Example

curl 'https://openapi.guance.com/api/v1/crontab_report/add' \
-H 'Accept-Language: zh' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json, text/plain, */*' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"title":"ceshi2","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/Shanghai","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/Shanghai",
        "title": "ceshi2",
        "updateAt": 1698665760,
        "updator": "wsak_xxxxx",
        "uuid": "cron_xxxx32",
        "variables": {},
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-F4667E68-FB26-4987-891B-F00909A2948D"
} 

Feedback

Is this page helpful? ×