SuperAPI AI 工具集

iblai-notifications

办公与效率

查看项目

更新于 10-16 05:55

技能介绍

用途:通过 ibl.ai 平台 API 读取和发送组织通知,包括未读数量、通知列表、标记已读,以及两步式通知构建器(先预览再发送/定时)。

认证与约定:基础地址为 https://api.iblai.app;每个请求需带请求头 Authorization: Api-Token $IBLAI_API_KEY。路径变量 {org} 对应 $IBLAI_ORG,{username} 对应 $IBLAI_USERNAME。这些是平台级端点,主机为 DM,路径在 /api/notification/v1/… 下。若尚未连接,先运行 /iblai-login 以填充 IBLAI_ORG、IBLAI_USERNAME 和 IBLAI_API_KEY。

读取:GET /dm/api/notification/v1/orgs/{org}/users/{username}/notifications-count/?status=UNREAD 获取未读数量(也支持 channel);GET /dm/api/notification/v1/orgs/{org}/users/{username}/notifications/ 获取通知列表,支持 channel、status、start_date、end_date、exclude_channel 筛选。

写入:POST /dm/api/notification/v1/orgs/{org}/mark-all-as-read 标记全部或指定通知为已读,请求体为 {"notification_ids": "uuid[]"},省略或为空表示标记全部未读。POST /dm/api/notification/v1/orgs/{org}/notification-builder/preview/ 为构建器第一步,返回 build_id,请求体含 channels(必填,整数数组)、sources(必填,来自收件人邮箱)、template_id、template_data、context、process_on(ISO 时间,用于定时)。POST /dm/api/notification/v1/orgs/{org}/notification-builder/send/ 为第二步,请求体为 {"build_id": "string"},用于实际发送或定时。

示例:curl -s "https://api.iblai.app/dm/api/notification/v1/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/notifications-count/?status=UNREAD" -H "Authorization: Api-Token $IBLAI_API_KEY"。

限制与注意:发送通知是对外操作,发送前应与用户确认收件人;构建器必须两步完成,先 preview 获取 build_id,再 send 使用该 build_id 发送或定时;mark-all-as-read 省略 notification_ids 会标记全部未读。