SuperAPI AI 工具集

line-openapi-skill

编程与开发

查看项目

更新于 10-16 09:56

技能介绍

用途:通过 uxc 与精选 OpenAPI 架构执行 LINE Messaging API 操作,复用 uxc 的共享执行、认证与错误处理指引。

前提:uxc 已安装并在 PATH 中;可访问 https://api.line.me;可获取精选 OpenAPI 架构 https://raw.githubusercontent.com/holon-run/uxc/main/skills/line-openapi-skill/references/line-messaging.openapi.json;拥有 LINE Messaging API 通道访问令牌。

认证:使用 Authorization: Bearer <channel access token>。配置 Bearer 凭据并绑定到 api.line.me: uxc auth credential set line-channel --auth-type bearer --secret-env LINE_CHANNEL_ACCESS_TOKEN uxc auth binding add --id line-channel --host api.line.me --scheme https --credential line-channel --priority 100 可用 uxc auth binding match https://api.line.me 校验映射。

用法:默认使用固定链接命令 line-openapi-cli;若不存在则创建: uxc link line-openapi-cli https://api.line.me --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/line-openapi-skill/references/line-messaging.openapi.json 先查看操作架构,再读写。例如 get:/v2/bot/info、get:/v2/bot/profile/{userId}、post:/v2/bot/message/push -h。写操作前优先读/校验:get:/v2/bot/info、get:/v2/bot/message/quota、get:/v2/bot/channel/webhook/endpoint。支持键值或位置 JSON 传参。

操作组:读取/查找(bot info、用户资料、配额、配额消耗、webhook 端点);消息(push、reply);webhook 端点管理(put、test)。

护栏:保持 JSON 输出信封,勿用 --text;优先解析 ok、kind、protocol、data、error;使用目标机器人/通道所需范围的令牌;push 与 reply 为写/高风险操作,执行前需用户明确确认;replyToken 短时有效且来自 webhook;webhook 端点 get/set/test 仅配置投递,不提供接收运行时。

范围限制:不覆盖入站 webhook 接收运行时、api-data.line.me 的媒体/内容下载、受众、narrowcast、rich menu、账号管理及完整 LINE Messaging API;本 v1 技能限定 https://api.line.me。line-openapi-cli <operation> 等价于 uxc https://api.line.me --schema-url <line_openapi_schema> <operation>。参考:references/usage-patterns.md、references/line-messaging.openapi.json 及 LINE 官方参考。