返回顶部
s

sending-sms发送短信

Sends SMS messages via the Sendly API with the Node.js SDK or REST API. Handles single messages, batch sends, scheduling, conversations, and sandbox testing. Applies when sending text messages, notifications, alerts, or reminders via SMS.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
78
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

sending-sms

使用Sendly发送短信

快速开始

typescript
import Sendly from @sendly/node;

const sendly = new Sendly(process.env.SENDLYAPIKEY!);

const message = await sendly.messages.send({
to: +15551234567,
text: 您的订单已发货!,
messageType: transactional,
});

身份验证

所有请求都需要Bearer令牌。将API密钥存储在SENDLYAPIKEY环境变量中。

  • - sktest密钥 → 沙盒模式(不发送真实短信,不扣除积分)
  • sklive密钥 → 生产环境(向已验证号码发送真实短信)

REST API

基础URL: https://sendly.live/api/v1

发送消息

bash
curl -X POST https://sendly.live/api/v1/messages \
-H Authorization: Bearer $SENDLYAPIKEY \
-H Content-Type: application/json \
-d {to: +15551234567, text: 你好!, messageType: transactional}

必填字段: to(E.164格式)、text、messageType(transactional或marketing)

可选字段: metadata(对象,最大4KB)、from(发送者ID)

响应格式

json
{
id: msg_abc123,
to: +15551234567,
text: 你好!,
status: sent,
segments: 1,
creditsUsed: 2,
createdAt: 2026-03-31T10:00:00Z
}

定时发送消息

bash
curl -X POST https://sendly.live/api/v1/messages/schedule \
-H Authorization: Bearer $SENDLYAPIKEY \
-H Content-Type: application/json \
-d {to: +15551234567, text: 提醒!, messageType: transactional, scheduledAt: 2026-04-01T14:00:00Z}

定时窗口:未来5分钟到5天之间。

批量发送

bash
curl -X POST https://sendly.live/api/v1/messages/batch \
-H Authorization: Bearer $SENDLYAPIKEY \
-H Content-Type: application/json \
-d {messages: [{to: +15551234567, text: 你好}, {to: +15559876543, text: 嗨}], messageType: transactional}

每批次最多10,000个收件人。

列出消息

bash
curl https://sendly.live/api/v1/messages?limit=50 \
-H Authorization: Bearer $SENDLYAPIKEY

支持limit、offset、status、q(全文搜索)。

Node.js SDK

bash
npm install @sendly/node

typescript
import Sendly from @sendly/node;

const sendly = new Sendly(process.env.SENDLYAPIKEY!);

const msg = await sendly.messages.send({ to: +15551234567, text: 你好!, messageType: transactional });
const scheduled = await sendly.messages.schedule({ to: +15551234567, text: 稍后!, messageType: transactional, scheduledAt: 2026-04-01T14:00:00Z });
const batch = await sendly.messages.batch({ messages: [{to: +15551234567, text: 嗨}], messageType: transactional });
const list = await sendly.messages.list({ limit: 50 });
const single = await sendly.messages.get(msg_abc123);

消息类型

  • - transactional:OTP验证码、订单确认、预约提醒、账户通知。全天候允许发送。
  • marketing:促销活动、打折信息、新闻通讯。受静默时段限制(收件人当地时间晚上9点至早上8点)。

将营销消息错误归类为事务性消息违反TCPA规定。

沙盒测试

使用sktest*密钥配合魔法电话号码:

号码行为
+15005550000始终成功
+15005550001
无效号码错误 |
| +15005550002 | 无法路由错误 |
| +15005550006 | 运营商拒绝 |

积分费用

  • - 美国/加拿大:每条短信2积分($0.02)
  • 国际:因国家而异(2–48积分)
  • 1积分 = $0.01

对话API

消息会自动归入对话线程。使用对话API进行双向消息传递:

typescript
const convos = await sendly.conversations.list({ status: active, limit: 20 });
const replies = await sendly.conversations.suggestReplies(conv_abc123);

完整参考

  • - API文档:https://sendly.live/docs/sms
  • SDK文档:https://sendly.live/docs/sdks
  • OpenAPI规范:https://sendly.live/openapi.yaml
  • 沙盒文档:https://sendly.live/docs/sandbox

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 sending-sms-1775881501 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 sending-sms-1775881501 技能

通过命令行安装

skillhub install sending-sms-1775881501

下载

⬇ 下载 sending-sms v1.0.0(免费)

文件大小: 2.2 KB | 发布时间: 2026-4-12 11:19

v1.0.0 最新 2026-4-12 11:19
- Initial release of the sending-sms skill.
- Send SMS messages using the Sendly API via Node.js SDK or REST API.
- Supports single messages, batch sending (up to 10,000 recipients), message scheduling, and SMS conversations.
- Includes sandbox testing with test API keys and magic phone numbers.
- Handles both transactional and marketing message types, with compliance notes.
- Full documentation and API references linked.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部