SuperAPI AI 工具集

plain

编程与开发

查看项目

更新于 10-16 09:47

技能介绍

用途:该技能面向 Plain.com 的客户支持场景,当用户提到 Plain、Plain.com、support threads,或需要在 Plain 中管理客户时使用。

主要能力:支持列出客服会话(List Threads)、按 ID 获取单个会话、回复会话、创建或更新客户(Upsert Customer)、按邮箱查询客户,以及列出标签类型和向会话添加标签。

使用方式:所有请求均为 GraphQL,统一向端点 POST https://core-api.uk.plain.com/graphql/v1 发送。通常先把查询或变更写入 /tmp/plain_request.json,再用 curl 携带 Authorization: Bearer $PLAIN_TOKEN 请求。会话状态包括 TODO(需处理)、SNOOZED(等待中)、DONE(已解决)。分页使用 Relay 风格游标分页,传 first 以及来自 pageInfo.endCursor 的 after。连接排查可运行 zero doctor check-connector --env-name PLAIN_TOKEN,或 zero doctor check-connector --url https://core-api.uk.plain.com/graphql/v1 --method POST。

限制:变更操作在响应体中返回 error 字段,即便 HTTP 状态为 200 也可能含错误,需始终检查。机器用户权限应只授予最小必要范围(如 threads:read、customers:write)。完整 schema 见 https://core-api.uk.plain.com/graphql/v1/schema.graphql,文档见 https://www.plain.com/docs/graphql/introduction。