Skip to content

应用订阅 ​

应用订阅 ​

应用订阅支持给指定用户通过邮件方式分发数据或者报表的功能,目前支持企业微信、钉钉、飞书、Webhook等分发途径

应用订阅的数据说明 ​

数据结构 ​

名称位置类型必选说明
appIdpathstring是none
bodybodyobject否none
» emailbodyobject否邮件推送配置
»» dashboardListbody[object]否推送仪表盘列表
»»» idbodyinteger否仪表盘id
»»» titlebodystring否仪表盘标题
»» buildMessageAsOwnerbodyboolean否使用订阅创建者的身份导出数据并生成消息内容
»» bodyWithDashboardUrlbodyboolean否正文是否附加仪表盘链接
»» enabledbodyboolean否是否开启
»» bodyWithImagebodyboolean否正文是否附加仪表盘图片
»» compressAttachmentbodyboolean否是否压缩附加
»» receiverListbody[object]否衡石系统内接收者列表
»»» idbodyinteger否接收者id
»»» namebodystring否none
»»» loginNamebodystring否none
»»» receiverTypebodystring否接收人类型
»» emailSubjectbodystring否主题
»» defaultEmailSubjectbodystring否默认主题
»» emailContentBodybodystring否内容
»» defaultEmailContentBodybodystring否默认内容
»» tooLargeContentBodybodystring否附件内容过大时替换内容
»» defaultTooLargeContentBodybodystring否默认附件内容过大时替换内容
»» attachmentTypesbodystring否附件类型
»» emailAddressListbody[string]否邮箱地址列表
» webhookbodyobject否webhook推送配置
»» enabledbodyboolean否是否开启
»» urlbodystring否webhook推送目的地址
»» methodbodystring否HTTP请求类型
»» requestBodybodystring否请求体(仅支持json格式请求体)
»» headersbody[string]否请求头
» wecombodyobject否企业微信推送配置
»» buildMessageAsOwnerbodyboolean否使用订阅创建者的身份导出数据并生成消息内容
»» dashboardListbody[object]否none
»»» idbodyinteger否none
»»» titlebodystring否none
»» bodyWithDashboardUrlbodyboolean否none
»» enabledbodyboolean否none
»» bodyWithImagebodyboolean否none
»» targetsbody[string]否企业微信用户id列表
»» receiverListbody[object]否衡石系统内接收者列表
»»» idbodyinteger否接收者id
»»» namebodystring否none
»»» loginNamebodystring否none
»»» receiverTypebodystring否接收人类型
»» subjectbodystring否消息主题
»» contentbodystring否消息内容
»» bodyCustomizedbodyboolean否是否开启自定义消息
»» defaultContentbodystring否默认消息内容
» feishubodyobject否飞书推送配置
»» buildMessageAsOwnerbodyboolean否使用订阅创建者的身份导出数据并生成消息内容
»» dashboardListbody[object]否none
»»» idbodyinteger否none
»»» titlebodystring否none
»» bodyWithDashboardUrlbodyboolean否none
»» enabledbodyboolean否none
»» bodyWithImagebodyboolean否none
»» targetsbody[string]否飞书用户id列表
»» receiverListbody[object]否衡石系统内接收者列表
»»» idbodyinteger否接收者id
»»» namebodystring否none
»»» loginNamebodystring否none
»»» receiverTypebodystring否接收人类型
»» subjectbodystring否none
»» contentbodystring否none
»» bodyCustomizedbodyboolean否none
»» defaultContentbodystring否none
» dingtalkbodyobject否钉钉推送配置
»» buildMessageAsOwnerbodyboolean否使用订阅创建者的身份导出数据并生成消息内容
»» dashboardListbody[object]否none
»»» idbodyinteger否none
»»» titlebodystring否none
»» bodyWithDashboardUrlbodyboolean否none
»» enabledbodyboolean否none
»» bodyWithImagebodyboolean否none
»» targetsbody[string]否钉钉用户id列表
»» receiverListbody[object]否衡石系统内接收者列表
»»» idbodyinteger否接收者id
»»» namebodystring否none
»»» loginNamebodystring否none
»»» receiverTypebodystring否接收人类型
»» subjectbodystring否none
»» contentbodystring否none
»» bodyCustomizedbodyboolean否none
»» defaultContentbodystring否none
» appIdbodyinteger否none
» titlebodystring否none

收件人类型 ​

字段值描述
USER用户
ORGANIZATION用户组
DEPARTMENT组织机构

邮件附件类型 ​

字段值描述
PNGpng文件
PDFpdf文件
EXCELexcel文件

接口说明 ​

增加邮件推送任务 ​

创建应用的邮件推送任务。单个用户的推送失败会被忽略。原/api/apps/{appId}/emails接口。

http
POST /api/apps/{appId}/subscribe-record HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "email": {
    "enabled": false,
    "receiverList": [
      {
        "id": 2,
        "name": "xx",
        "loginName": "xxx",
        "receiverType": "USER"
      }
    ],
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithImage": true,
    "compressAttachment": false,
    "bodyWithDashboardUrl": true,
    "defaultEmailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
    "defaultEmailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
    "defaultTooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。",
    "emailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
    "emailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
    "tooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。"
  },
  "wecom": {
    "enabled": true,
    "bodyWithImage": true,
    "subject": "企业微信测试主题",
    "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
    "bodyCustomized": true,
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithDashboardUrl": true,
    "targets": [
      "xxxx"
    ]
  },
  "feishu": {
    "enabled": true,
    "bodyWithImage": true,
    "subject": "企业微信测试主题",
    "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
    "bodyCustomized": true,
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithDashboardUrl": true,
    "targets": [
      "xxxx"
    ]
  },
  "webhook": {
    "enabled": true,
    "url": "https://xxxxx",
    "requestBody": "{\"msgtype\":\"text\",\"text\":{\"content\":\"广州今日天气:29度,大部分多云,降雨概率:60%\",\"mentioned_mobile_list\":[\"xxxx\"]}}",
    "method": "POST"
  },
  "title": "测试一号图片"
}
http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "email": {
    "enabled": true,
    "config": {
      "receiverList": [
        {
          "id": 0,
          "name": "string",
          "loginName": "string",
          "receiverType": "string"
        }
      ],
      "dashboardList": [
        {
          "id": 0,
          "title": "string"
        }
      ],
      "compressAttachment": true,
      "emailSubject": "string",
      "defaultEmailSubject": "string",
      "emailContentBody": "string",
      "defaultEmailContentBody": "string",
      "tooLargeContentBody": "string",
      "defaultTooLargeContentBody": "string",
      "bodyWithDashboardUrl": true
    }
  },
  "webhook": {
    "enabled": true,
    "config": {
      "url": "string",
      "method": "string",
      "headers": [
        {}
      ],
      "requestBody": "string"
    }
  },
  "wecom": {
    "enabled": true,
    "config": {
      "targets": [
        "string"
      ],
      "subject": "string",
      "content": "string",
      "defaultContent": "string",
      "bodyCustomized": "string",
      "dashboardList": [
        {
          "id": 0,
          "title": "string"
        }
      ],
      "bodyWithImage": true,
      "bodyWithDashboardUrl": true
    }
  },
  "feiShu": {
    "enabled": true,
    "config": {
      "targets": [
        "string"
      ],
      "subject": "string",
      "content": "string",
      "defaultContent": "string",
      "bodyCustomized": "string",
      "dashboardList": [
        {
          "id": 0,
          "title": "string"
        }
      ],
      "bodyWithImage": true,
      "bodyWithDashboardUrl": true
    }
  },
  "title": "string"
}

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

获取订阅任务列表 ​

原/api/apps/{appId}/emails接口。

请求参数 ​

名称位置类型必选说明
appIdpathstring是none
http
GET /api/apps/{appId}/subscribe-record HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": [
    {
      "email": {
        "dashboardList": [
          {
            "id": 1,
            "title": "新建仪表盘"
          }
        ],
        "bodyWithDashboardUrl": true,
        "enabled": false,
        "bodyWithImage": true,
        "compressAttachment": false,
        "receiverList": [
          {
            "id": 2,
            "name": "xx",
            "loginName": "xxx",
            "receiverType": "USER"
          }
        ],
        "emailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
        "defaultEmailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
        "emailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
        "defaultEmailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
        "tooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。",
        "defaultTooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。"
      },
      "webhook": {
        "enabled": true,
        "url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxx",
        "method": "POST",
        "requestBody": "{\"msgtype\":\"text\",\"text\":{\"content\":\"广州今日天气:29度,大部分多云,降雨概率:60%\",\"mentioned_mobile_list\":[\"xxxx\"]}}"
      },
      "wecom": {
        "dashboardList": [
          {
            "id": 1,
            "title": "新建仪表盘"
          }
        ],
        "bodyWithDashboardUrl": true,
        "enabled": true,
        "bodyWithImage": true,
        "targets": [
          "xxxx"
        ],
        "subject": "企业微信测试主题",
        "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
        "bodyCustomized": true
      },
      "feishu": {
        "dashboardList": [
          {
            "id": 1,
            "title": "新建仪表盘"
          }
        ],
        "bodyWithDashboardUrl": true,
        "enabled": true,
        "bodyWithImage": true,
        "targets": [
          "xxx"
        ],
        "subject": "企业微信测试主题",
        "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
        "bodyCustomized": true
      },
      "id": 2,
      "appId": 610,
      "title": "测试一号图片",
      "createdBy": 2,
      "createdAt": "2023-10-13 11:16:12",
      "updatedBy": 2,
      "updatedAt": "2023-10-16 12:11:34",
      "isDelete": false,
      "creator": {
        "id": 2,
        "name": "xxx",
        "loginName": "xxx"
      },
      "updater": {
        "id": 2,
        "name": "xxx",
        "loginName": "xxx"
      },
      "jobStatus": "SUCCESSFUL",
      "startAt": "2023-10-16 12:19:09",
      "entityKey": "610-2",
      "execDetail": {
        "jobClass": "com.hengshi.nangaparbat.schedulejob.AppEmailJob",
        "jobParams": {
          "app": 610,
          "email": 2
        },
        "retryTimes": 1
      }
    },
    {
      "email": {
        "dashboardList": [
          {
            "id": 1,
            "title": "新建仪表盘"
          }
        ],
        "bodyWithDashboardUrl": true,
        "enabled": true,
        "compressAttachment": false,
        "receiverList": [
          {
            "id": 2,
            "name": "xxx",
            "loginName": "xxx",
            "receiverType": "USER"
          }
        ],
        "emailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
        "defaultEmailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
        "emailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
        "defaultEmailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
        "tooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。",
        "defaultTooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。"
      },
      "id": 1,
      "appId": 610,
      "title": "测试订阅一",
      "createdBy": 2,
      "createdAt": "2023-10-12 19:18:07",
      "updatedBy": 2,
      "updatedAt": "2023-10-12 19:18:07",
      "isDelete": false,
      "creator": {
        "id": 2,
        "name": "xx",
        "loginName": "xxx"
      },
      "updater": {
        "id": 2,
        "name": "xx",
        "loginName": "xxx"
      },
      "execDetail": {
        "jobClass": "com.hengshi.nangaparbat.schedulejob.AppEmailJob",
        "jobParams": {
          "app": 610,
          "email": 1
        },
        "retryTimes": 1
      }
    }
  ],
  "totalHits": 2,
  "offset": 0,
  "chartDataStartTimeMillis": 0
}

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

立即推送邮件 ​

立即执行当前邮件推送任务。

http
POST /api/schedules HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "entityGroup": "APP_EMAIL",
  "entityKey": "550-2",
  "planItems": [
    {
      "triggerType": "ONCE"
    }
  ],
  "execDetail": {
    "jobClass": "com.hengshi.nangaparbat.schedulejob.AppEmailJob",
    "jobParams": {
      "app": 550,
      "email": 2
    },
    "retryTimes": 1
  }
}

请求参数 ​

名称位置类型必选说明
bodybodyobject否none
» entityGroupbodystring是none
» entityKeybodystring是none
» planItemsbody[object]是none
»» triggerTypebodystring否none
» execDetailbodyobject是none
»» jobClassbodystring是none
»» jobParamsbodyobject是none
»»» appbodyinteger是none
»»» emailbodyinteger是none
»» retryTimesbodyinteger是none

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

根据ID获取订阅任务 ​

原/api/apps/{appId}/emails/{emailId}接口

请求参数 ​

名称位置类型必选说明
appIdpathstring是none
recordIdpathstring是none
http
GET /api/apps/{appId}/subscribe-record/{recordId} HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "version": "version@9a5e106#6730f0d",
  "code": 0,
  "msg": "success",
  "data": {
    "email": {
      "dashboardList": [
        {
          "id": 1,
          "title": "新建仪表盘"
        }
      ],
      "bodyWithDashboardUrl": true,
      "enabled": false,
      "bodyWithImage": true,
      "compressAttachment": false,
      "receiverList": [
        {
          "id": 2,
          "name": "xxx",
          "loginName": "xxx",
          "receiverType": "USER"
        }
      ],
      "emailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
      "defaultEmailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
      "emailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
      "defaultEmailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
      "tooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。",
      "defaultTooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。"
    },
    "webhook": {
      "enabled": true,
      "url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx",
      "method": "POST",
      "requestBody": "{\"msgtype\":\"text\",\"text\":{\"content\":\"广州今日天气:29度,大部分多云,降雨概率:60%\",\"mentioned_mobile_list\":[\"xxx\"]}}"
    },
    "wecom": {
      "dashboardList": [
        {
          "id": 1,
          "title": "新建仪表盘"
        }
      ],
      "bodyWithDashboardUrl": true,
      "enabled": true,
      "bodyWithImage": true,
      "targets": [
        "xxxxx"
      ],
      "subject": "企业微信测试主题",
      "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
      "bodyCustomized": true
    },
    "feishu": {
      "dashboardList": [
        {
          "id": 1,
          "title": "新建仪表盘"
        }
      ],
      "bodyWithDashboardUrl": true,
      "enabled": true,
      "bodyWithImage": true,
      "targets": [
        "xxxx"
      ],
      "subject": "企业微信测试主题",
      "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
      "bodyCustomized": true
    },
    "id": 2,
    "appId": 610,
    "title": "测试一号图片",
    "createdBy": 2,
    "createdAt": "2023-10-13 11:16:12",
    "updatedBy": 2,
    "updatedAt": "2023-10-16 12:11:34",
    "isDelete": false,
    "creator": {
      "id": 2,
      "name": "xxx",
      "loginName": "xxx"
    },
    "updater": {
      "id": 2,
      "name": "xxx",
      "loginName": "xxx"
    },
    "jobStatus": "SUCCESSFUL",
    "startAt": "2023-10-16 12:19:09",
    "entityKey": "610-2",
    "execDetail": {
      "jobClass": "com.hengshi.nangaparbat.schedulejob.AppEmailJob",
      "jobParams": {
        "app": 610,
        "email": 2
      },
      "retryTimes": 1
    }
  },
  "chartDataStartTimeMillis": 0
}

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

更新订阅任务 ​

原/api/apps/{appId}/emails/{emailId}接口。

http
PUT /api/apps/{appId}/subscribe-record/{recordId} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

// Request Body:
{
  "email": {
    "enabled": false,
    "receiverList": [
      {
        "id": 2,
        "name": "xx",
        "loginName": "xxx",
        "receiverType": "USER"
      }
    ],
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithImage": true,
    "compressAttachment": false,
    "bodyWithDashboardUrl": true,
    "defaultEmailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
    "defaultEmailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
    "defaultTooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。",
    "emailSubject": "【系统自动推送】'{{%%system.app.title}}_{{%%system.today}}'",
    "emailContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 您也可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 如遇到任何问题,请咨询系统管理员。",
    "tooLargeContentBody": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统应当自动推送{{%%system.app.title}}应用内容给您。<br/> 但是非常抱歉,由于您选择的内容过大,系统无法自动推送。<br/> 您可以访问<a target=\"view_frame\" href=\"{{%%system.app.url}}\">应用URL地址</a>获取应用所有仪表盘及数据集。<br/> 建议您登录平台更改设定,如有问题请咨询系统管理员。"
  },
  "wecom": {
    "enabled": true,
    "bodyWithImage": true,
    "subject": "企业微信测试主题",
    "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
    "bodyCustomized": true,
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithDashboardUrl": true,
    "targets": [
      "xxxx"
    ]
  },
  "feishu": {
    "enabled": true,
    "bodyWithImage": true,
    "subject": "企业微信测试主题",
    "content": "尊敬的客户您好!<br/> 根据您在平台中的推送设定,系统自动推送{{%%system.app.title}}应用内容给您。<br/> 如遇到任何问题,请咨询系统管理员。",
    "bodyCustomized": true,
    "dashboardList": [
      {
        "id": 1,
        "title": "新建仪表盘"
      }
    ],
    "bodyWithDashboardUrl": true,
    "targets": [
      "xxxx"
    ]
  },
  "webhook": {
    "enabled": true,
    "url": "https://xxxxx",
    "requestBody": "{\"msgtype\":\"text\",\"text\":{\"content\":\"广州今日天气:29度,大部分多云,降雨概率:60%\",\"mentioned_mobile_list\":[\"xxxx\"]}}",
    "method": "POST"
  },
  "title": "测试一号图片"
}

请求参数 ​

参考订阅数据结构。

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

删除订阅任务 ​

http
DELETE /api/apps/{appId}/subscribe-record/{recordId} HTTP/1.1
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

原/api/apps/{appId}/emails/{emailId}接口。

请求参数 ​

名称位置类型必选说明
appIdpathstring是none
recordIdpathstring是none

返回结果 ​

状态码状态码含义说明数据模型
200OK成功Inline

HENGSHI SENSE API 使用手册