Retarus SMS4A
Overview
Use this skill for operational work with the Retarus SMS for Applications API: prepare or validate SMS job payloads, send jobs, and fetch per-recipient status for a jobId.
Prefer the helper script in scripts/sms4a_api.py instead of hand-writing HTTP calls. It already handles Basic Auth, simple payload construction, full-payload file input, datacenter selection, and the eu status fallback across de2 and de1.
Quick Start
- 1. Resolve credentials from the secret store into one of these supported inputs:
-
RETARUS_SMS4A_USERNAME and
RETARUS_SMS4A_PASSWORD
-
RETARUS_SMS4A_SECRET_FILE pointing to a JSON or
.env-style file with
username and
password
- The default local secret file path
~/.openclaw/secrets/retarus-sms4a.env or
~/.openclaw/secrets/retarus-sms4a.json
- Explicit
--username and
--password flags only for local testing
- 2. Send a simple SMS job:
CODEBLOCK0
- 3. Check recipient status for a job:
CODEBLOCK1
Datacenter Rules
- - Use
eu as the default send endpoint unless the user explicitly wants de1 or de2. - Do not rely on the
eu hostname for status lookups. The eu endpoint is DNS-balanced across de1 and de2, so a status lookup must try both datacenters. - The
status command defaults to --datacenter auto, which tries de2 first and then de1. - If the user explicitly prefers
de1 or de2, still try both datacenters and use the chosen one only as the first lookup target.
Sending Workflow
- - For common one-message jobs, pass
--text and one or more --recipient values. - For advanced jobs, pass
--payload-file with a JSON body matching the OpenAPI JobRequest schema. - Use
--dry-run first if you want to validate payload assembly without sending anything. - Return the created
jobId and the datacenter that accepted the job.
Status Workflow
- - Use
status --job-id ... to query GET /sms?jobId=.... - Return the successful datacenter together with the recipient reports.
- If one datacenter returns
404 or 500, continue with the next datacenter. - If both datacenters fail, report both attempts and their response codes.
Credential Handling
- - Never hardcode credentials into the skill files.
- Prefer secret-store backed environment injection.
- Prefer the standard local secret path
~/.openclaw/secrets/retarus-sms4a.env for operator-managed credentials on an OpenClaw host. - If a secret file is used, support either:
- JSON:
{"username":"...","password":"..."}
-
.env style:
CODEBLOCK2
Reference
- - Read
references/api.md for the server aliases, supported helper-script options, and the subset of the OpenAPI schema this skill uses most often.
Retarus SMS4A
概述
使用此技能进行Retarus短信应用API的操作工作:准备或验证短信任务负载、发送任务以及获取指定jobId的每个收件人状态。
建议使用scripts/sms4a_api.py中的辅助脚本,而非手动编写HTTP调用。该脚本已处理基本认证、简单负载构建、完整负载文件输入、数据中心选择以及跨de2和de1的eu状态回退。
快速开始
- 1. 从密钥存储中解析凭证到以下支持的输入之一:
- RETARUS
SMS4AUSERNAME 和 RETARUS
SMS4APASSWORD
- RETARUS
SMS4ASECRET_FILE 指向包含username和password的JSON或.env格式文件
- 默认本地密钥文件路径 ~/.openclaw/secrets/retarus-sms4a.env 或 ~/.openclaw/secrets/retarus-sms4a.json
- 仅限本地测试时使用显式的--username和--password参数
- 2. 发送一条简单短信任务:
bash
python3 scripts/sms4a_api.py send \
--datacenter eu \
--text 您的验证码是123456 \
--recipient +8617600000000 \
--status-requested
- 3. 查询任务收件人状态:
bash
python3 scripts/sms4a_api.py status --job-id J.20221116-102407.583-0lajfsfmoXIZJO93PQ
数据中心规则
- - 除非用户明确要求de1或de2,否则默认使用eu作为发送端点。
- 状态查询时不要依赖eu主机名。eu端点在de1和de2之间进行DNS负载均衡,因此状态查询必须尝试两个数据中心。
- status命令默认使用--datacenter auto,该选项会先尝试de2,再尝试de1。
- 如果用户明确偏好de1或de2,仍需尝试两个数据中心,仅将所选数据中心作为首次查询目标。
发送工作流
- - 对于常见的单条消息任务,传递--text和一个或多个--recipient值。
- 对于高级任务,传递--payload-file参数,附带符合OpenAPI JobRequest模式的JSON主体。
- 如需验证负载组装而不实际发送,可先使用--dry-run参数。
- 返回创建的jobId和接受该任务的数据中心。
状态工作流
- - 使用status --job-id ...查询GET /sms?jobId=...。
- 返回成功的数据中心及收件人报告。
- 如果一个数据中心返回404或500,则继续尝试下一个数据中心。
- 如果两个数据中心均失败,报告两次尝试及其响应码。
凭证处理
- - 切勿在技能文件中硬编码凭证。
- 优先使用密钥存储支持的环境变量注入。
- 在OpenClaw主机上,优先使用标准本地密钥路径~/.openclaw/secrets/retarus-sms4a.env来管理操作员凭证。
- 如果使用密钥文件,支持以下格式:
- JSON:{username:...,password:...}
- .env格式:
dotenv
RETARUSSMS4AUSERNAME=...
RETARUSSMS4APASSWORD=...
参考
- - 阅读references/api.md了解服务器别名、支持的辅助脚本选项以及此技能最常用的OpenAPI模式子集。