跳转至

列出



GET /api/v1/issue/notification_policy/list

概述

分页查询当前工作空间未删除的通知策略及其关联日程、频道和账号资料。

调用前和使用步骤

默认pageIndex=1、pageSize=10,按最后更新时间倒序;尚未更新的策略按创建时间比较。列表包含启用与禁用策略,通过status区分。策略数组在content.data,分页信息在顶层pageInfo。保存返回的uuid用于详情、修改或删除。策略需要在控制台关联到目标频道,并关联有效通知日程;实际接收人由日程的时区、当日时段、有效期、轮换和通知目标决定。保存策略本身不会立即发送测试通知。

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Query 请求参数

参数名 类型 必选 说明
search string 可选名称模糊搜索,服务端去除首尾空白;不要传null。
允许 null: True
例子: 生产
获取或填写方式: 输入策略名称的部分文本;省略或空字符串不筛选。
pageIndex integer 页码,默认1,最小1。
允许 null: False
$minValue: 1
例子: 1
获取或填写方式: 从1开始逐页增加,保持搜索条件一致。
pageSize integer 每页条数,默认10。
允许 null: False
$minValue: 1
$maxValue: 100
例子: 10
获取或填写方式: 按需要填写1至100的整数。

参数补充说明

返回的关联日程配置不是当前时刻真实接收人名单;实际目标还需按日程有效期、时段和轮换计算。

请求例子

curl --get 'https://openapi.guance.com/api/v1/issue/notification_policy/list' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-urlencode pageIndex=1 \
  --data-urlencode pageSize=10

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

字段 类型 说明
content.data array<object> 当前页策略,无结果为[]。
content.data[].id integer 已存在配置的数据库编号;后续接口定位使用uuid。
content.data[].uuid string 通知策略UUID,inpy_开头。
content.data[].workspaceUUID string 所属工作空间UUID。
content.data[].name string 策略名称。
content.data[].status integer 记录状态,0启用,2禁用,3删除;列表包含未删除的启用和禁用策略。
content.data[].creator string 创建调用身份。
content.data[].updator string 最近更新身份,未更新为空字符串。
content.data[].createAt integer 创建时间,Unix秒。
content.data[].updateAt integer 更新时间,Unix秒,未更新为-1。
content.data[].deleteAt integer 删除时间,Unix秒,未删除为-1。
content.data[].extend object 保存的通知范围与升级规则,可为{}。
content.data[].extend.notifyTypes array<string> 启用的动作类型。
content.data[].extend.notifyTypes[] string 单个动作类型,具体作用见参数表。
content.data[].extend.upgradeCfg object 按触发类型保存的规则。
content.data[].extend.upgradeCfg.noManager object Issue创建时没有有效负责人并进入无负责人候选,状态为Open/Working/Pending时,从Issue创建起等待;已有Issue仅移除负责人不保证重新进入候选。填写正整数秒且为60的倍数。启用类型为issueUpgrade.noManager,未配置时省略。
content.data[].extend.upgradeCfg.noManager.duration integer 首次等待秒数。
content.data[].extend.upgradeCfg.noManager.notifyType string once或cycle;未保存该值时按once。
content.data[].extend.upgradeCfg.noManager.cycleDuration integer 循环间隔,单位秒,cycle模式使用。
content.data[].extend.upgradeCfg.noManager.cycleTimes integer 循环触发总次数上限,1至30,包含首次。
content.data[].extend.upgradeCfg.processTimeout object Issue处于Open/Working的持续未完成时间。首次从创建计时;从Pending/Resolved/Closed重新进入处理状态时,从重新进入后的状态记录计时。启用类型为issueUpgrade.processTimeout,未配置时省略。
content.data[].extend.upgradeCfg.processTimeout.duration integer 首次等待秒数。
content.data[].extend.upgradeCfg.processTimeout.notifyType string once或cycle;未保存该值时按once。
content.data[].extend.upgradeCfg.processTimeout.cycleDuration integer 循环间隔,单位秒,cycle模式使用。
content.data[].extend.upgradeCfg.processTimeout.cycleTimes integer 循环触发总次数上限,1至30,包含首次。
content.data[].extend.upgradeCfg.openProcessTimeout object 仅Issue保持Open时生效,从最后一次状态变更时间计时;没有状态记录则从创建时间计时。启用类型为issueUpgrade.processTimeout,未配置时省略。
content.data[].extend.upgradeCfg.openProcessTimeout.duration integer 首次等待秒数。
content.data[].extend.upgradeCfg.openProcessTimeout.notifyType string once或cycle;未保存该值时按once。
content.data[].extend.upgradeCfg.openProcessTimeout.cycleDuration integer 循环间隔,单位秒,cycle模式使用。
content.data[].extend.upgradeCfg.openProcessTimeout.cycleTimes integer 循环触发总次数上限,1至30,包含首次。
content.data[].extend.upgradeCfg.eventStorm object Issue记录的eventCount严格大于exceedTimes后触发;不按Open/Working状态限定,已完成Issue也可能满足数量条件。启用类型为issueUpgrade.eventStorm,未配置时省略。
content.data[].extend.upgradeCfg.eventStorm.exceedTimes integer 数量阈值,eventCount严格超过才触发。
content.data[].extend.upgradeCfg.eventStorm.notifyType string once或cycle;未保存该值时按once。
content.data[].extend.upgradeCfg.eventStorm.cycleDuration integer 循环间隔,单位秒,cycle模式使用。
content.data[].extend.upgradeCfg.eventStorm.cycleTimes integer 循环触发总次数上限,1至30,包含首次。
content.data[].extend.其他字段 JSON 来源保存的其他扩展字段,不代表都能控制通知行为。
content.data[].relNotificationScheduleInfos array<object> 关联的有效日程对象;列表另含格式化有效期,详情仅为原始日程配置。
content.data[].relNotificationScheduleInfos[].id integer 数据库记录编号;操作日程使用uuid。
content.data[].relNotificationScheduleInfos[].uuid string 日程 UUID,供查询、修改、删除及通知策略引用。
content.data[].relNotificationScheduleInfos[].workspaceUUID string 所属工作空间 UUID。
content.data[].relNotificationScheduleInfos[].name string 日程名称。
content.data[].relNotificationScheduleInfos[].timezone string 此日程解释当日时段和生效日期所用的 IANA 时区。
content.data[].relNotificationScheduleInfos[].start string 当日开始时刻 HH:MM。
content.data[].relNotificationScheduleInfos[].end string 当日结束时刻 HH:MM,结束分钟的最后一秒仍有效。
content.data[].relNotificationScheduleInfos[].notifyTargets array<string> 按顺序保存的成员、通知对象 UUID 或邮箱。
content.data[].relNotificationScheduleInfos[].notifyTargets[] string acnt_ 账号、notify_ 通知对象或邮箱字符串。
content.data[].relNotificationScheduleInfos[].extend object 扩展配置;未配置可为 {}。
content.data[].relNotificationScheduleInfos[].extend.enableRotateNotification boolean 是否启用轮换;缺省按 false。
content.data[].relNotificationScheduleInfos[].extend.rotationCycle string 启用轮换时的周期:day按日、week按周一、month按自然月、workDay仅工作日逐日、weekend仅周末逐日。不识别节假日,未配置可省略。
content.data[].relNotificationScheduleInfos[].extend.effectiveTime object 整体有效期,未配置可省略。
content.data[].relNotificationScheduleInfos[].extend.effectiveTime.start integer 有效期开始 Unix 秒;0 或省略不限制。
content.data[].relNotificationScheduleInfos[].extend.effectiveTime.end integer 有效期结束 Unix 秒;0 或省略不限制。
content.data[].relNotificationScheduleInfos[].rotationUpdateAt integer 轮换计算的起始时间,Unix 秒。更改轮换相关配置时重置。
content.data[].relNotificationScheduleInfos[].status integer 记录状态,活动记录为 0。
content.data[].relNotificationScheduleInfos[].creator string 创建调用身份。
content.data[].relNotificationScheduleInfos[].updator string 最近更新身份;未更新为空字符串。
content.data[].relNotificationScheduleInfos[].createAt integer 创建时间,Unix 秒。
content.data[].relNotificationScheduleInfos[].updateAt integer 更新时间,Unix 秒;未更新为 -1。
content.data[].relNotificationScheduleInfos[].deleteAt integer 删除时间,Unix 秒;未删除为 -1。
content.data[].relChannelInfos array<object> 引用此策略的频道对象。
content.data[].relChannelInfos[].id integer 频道记录编号。
content.data[].relChannelInfos[].uuid string 频道 UUID,供修改、删除或订阅使用。
content.data[].relChannelInfos[].workspaceUUID string 频道所属工作空间。
content.data[].relChannelInfos[].name string 频道名称。default 表示默认频道。
content.data[].relChannelInfos[].description string 频道描述。
content.data[].relChannelInfos[].notifyTarget array<string> 该频道直接配置的通知对象 UUID。
content.data[].relChannelInfos[].notifyTarget[] string 单个通知对象 UUID。
content.data[].relChannelInfos[].notifyUpgradeCfg object 升级通知配置,未配置时为空对象。
content.data[].relChannelInfos[].notifyUpgradeCfg.triggerTime integer 触发升级通知的等待时长,单位秒。
content.data[].relChannelInfos[].notifyUpgradeCfg.notifyTarget array<string> 升级通知对象 UUID 列表。
content.data[].relChannelInfos[].notifyUpgradeCfg.notifyTarget[] string 升级通知对象 UUID。
content.data[].relChannelInfos[].status integer 记录状态,正常为 0。
content.data[].relChannelInfos[].creator string 创建调用身份。
content.data[].relChannelInfos[].updator string 最近更新身份,未更新可为空字符串。
content.data[].relChannelInfos[].createAt integer 创建时间,Unix 秒。
content.data[].relChannelInfos[].updateAt integer 更新时间,Unix 秒,未更新为 -1。
content.data[].relChannelInfos[].deleteAt integer 删除时间,Unix 秒,未删除为 -1。
content.data[].relNotificationScheduleInfos[].effectiveTimeInfos object 列表补充的日程整体有效期显示信息。
content.data[].relNotificationScheduleInfos[].effectiveTimeInfos.timeStr string 格式化有效期,可为空字符串。
content.data[].relNotificationScheduleInfos[].effectiveTimeInfos.expired boolean 整体有效期是否已结束。
content.data[].creatorInfo object 或 null 创建/更新身份的可解析账户资料。API Key不属于自然人成员,列表可返回null,详情可为空对象;以下字段按身份可选。
content.data[].creatorInfo.id integer 账号记录编号。
content.data[].creatorInfo.uuid string 账号UUID。
content.data[].creatorInfo.name string 账号名称。
content.data[].creatorInfo.username string 登录名。
content.data[].creatorInfo.email string 账号邮箱。
content.data[].creatorInfo.source string 账号来源。
content.data[].creatorInfo.userIconUrl string 头像URL。
content.data[].creatorInfo.exterId string 外部身份标识。
content.data[].creatorInfo.mobile string 手机号。
content.data[].creatorInfo.countryCode string 国家/地区码。
content.data[].creatorInfo.namespace string 身份命名空间。
content.data[].creatorInfo.attributes object 或 array 来源提供的账号属性。
content.data[].creatorInfo.attributes.自定义字段 JSON 由身份来源定义的属性。
content.data[].creatorInfo.customAttributes object 或 array 自定义账号属性。
content.data[].creatorInfo.customAttributes.自定义字段 JSON 自定义账号属性值。
content.data[].creatorInfo.acntWsNickname string 工作空间昵称。
content.data[].creatorInfo.defaultWebhook object 部分智能体账号的默认Webhook信息,可省略。
content.data[].creatorInfo.defaultWebhook.自定义字段 JSON 按账号来源配置的Webhook字段。
content.data[].updatorInfo object 或 null 创建/更新身份的可解析账户资料。API Key不属于自然人成员,列表可返回null,详情可为空对象;以下字段按身份可选。
content.data[].updatorInfo.id integer 账号记录编号。
content.data[].updatorInfo.uuid string 账号UUID。
content.data[].updatorInfo.name string 账号名称。
content.data[].updatorInfo.username string 登录名。
content.data[].updatorInfo.email string 账号邮箱。
content.data[].updatorInfo.source string 账号来源。
content.data[].updatorInfo.userIconUrl string 头像URL。
content.data[].updatorInfo.exterId string 外部身份标识。
content.data[].updatorInfo.mobile string 手机号。
content.data[].updatorInfo.countryCode string 国家/地区码。
content.data[].updatorInfo.namespace string 身份命名空间。
content.data[].updatorInfo.attributes object 或 array 来源提供的账号属性。
content.data[].updatorInfo.attributes.自定义字段 JSON 由身份来源定义的属性。
content.data[].updatorInfo.customAttributes object 或 array 自定义账号属性。
content.data[].updatorInfo.customAttributes.自定义字段 JSON 自定义账号属性值。
content.data[].updatorInfo.acntWsNickname string 工作空间昵称。
content.data[].updatorInfo.defaultWebhook object 部分智能体账号的默认Webhook信息,可省略。
content.data[].updatorInfo.defaultWebhook.自定义字段 JSON 按账号来源配置的Webhook字段。
content.declaration object 或 null 工作空间公共声明。
pageInfo object 顶层分页信息。
pageInfo.pageIndex integer 页码。
pageInfo.pageSize integer 页容量。
pageInfo.count integer 当前页实际数量。
pageInfo.totalCount integer 匹配的策略总数。
{
  "code": 200,
  "content": {
    "data": [
      {
        "id": 42,
        "uuid": "inpy_example",
        "workspaceUUID": "wksp_example",
        "name": "生产异常通知",
        "extend": {
          "notifyTypes": [
            "issue.add",
            "issue.modify",
            "issueReply.add",
            "issueUpgrade.noManager",
            "issueUpgrade.processTimeout",
            "issueUpgrade.eventStorm"
          ],
          "upgradeCfg": {
            "noManager": {
              "duration": 600,
              "notifyType": "once"
            },
            "processTimeout": {
              "duration": 1800,
              "notifyType": "cycle",
              "cycleDuration": 600,
              "cycleTimes": 3
            },
            "openProcessTimeout": {
              "duration": 900,
              "notifyType": "once"
            },
            "eventStorm": {
              "exceedTimes": 60,
              "notifyType": "once"
            }
          }
        },
        "status": 0,
        "creator": "wsak_example",
        "updator": "",
        "createAt": 1785430800,
        "updateAt": -1,
        "deleteAt": -1,
        "relNotificationScheduleInfos": [],
        "relChannelInfos": [],
        "creatorInfo": null,
        "updatorInfo": null
      }
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE",
  "pageInfo": {
    "pageIndex": 1,
    "pageSize": 10,
    "count": 1,
    "totalCount": 1
  }
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
406 ft.ParameterValidationFailed 请求字段缺失,或字段值违反声明的校验条件 参数解析失败 核对参数位置、字段名、类型和取值。
500 ft.InternalServerError 策略或关联资料读取失败 内部错误 稍后重试;持续失败提供traceId。

文档评价

文档内容是否对您有帮助?