send-sms-textbelt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Send Text Message

发送短信消息

Setup

设置

Read your credentials from ~/.gooseworks/credentials.json:
bash
export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])")
export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))")
If ~/.gooseworks/credentials.json does not exist, tell the user to run:
npx gooseworks login
All endpoints use Bearer auth:
-H "Authorization: Bearer $GOOSEWORKS_API_KEY"
Send SMS messages via the Textbelt API on Orthogonal.
从~/.gooseworks/credentials.json读取您的凭证:
bash
export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])")
export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))")
如果~/.gooseworks/credentials.json不存在,请告知用户运行:
npx gooseworks login
所有端点使用Bearer认证:
-H "Authorization: Bearer $GOOSEWORKS_API_KEY"
通过Orthogonal上的Textbelt API发送SMS消息。

Workflow

工作流程

Step 1: Gather Info

步骤1:收集信息

Ask the user for:
  • Phone number (required) - US/Canada: 10-digit with area code. International: E.164 format (e.g., +44...)
  • Message (required) - Max 800 characters. No URLs allowed.
向用户询问:
  • 电话号码(必填)- 美国/加拿大:含区号的10位数字。国际号码:E.164格式(例如+44...)
  • 消息内容(必填)- 最多800个字符。不允许包含URL。

Step 2: Send the Message

步骤2:发送消息

bash
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
  -H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api":"textbelt","path":"/text"}'
  "phone": "<phone_number>",
  "message": "<message_text>"
}'
bash
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
  -H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api":"textbelt","path":"/text"}'
  "phone": "<phone_number>",
  "message": "<message_text>"
}'

Step 3: Confirm Delivery

步骤3:确认送达

The response includes a
textId
. Use it to check delivery status:
bash
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
  -H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api":"textbelt","path":"/status/{textId}"}'
This endpoint is free.
响应中包含
textId
。使用它来检查送达状态:
bash
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
  -H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api":"textbelt","path":"/status/{textId}"}'
此端点免费。

Response

响应

Send Response (
/text
)

发送响应(
/text

  • success (boolean) -
    true
    if message was queued
  • textId (string) - Message ID for delivery tracking (only on success)
  • quotaRemaining (integer) - Remaining SMS credits
  • error (string) - Error message (only on failure)
  • success(布尔值)- 如果消息已排队则为
    true
  • textId(字符串)- 用于跟踪送达的消息ID(仅在成功时返回)
  • quotaRemaining(整数)- 剩余的SMS额度
  • error(字符串)- 错误消息(仅在失败时返回)

Status Response (
/status/{textId}
)

状态响应(
/status/{textId}

  • status (string) -
    DELIVERED
    ,
    SENDING
    ,
    FAILED
    , or
    UNKNOWN
  • status(字符串)-
    DELIVERED
    ,
    SENDING
    ,
    FAILED
    , or
    UNKNOWN

Constraints

限制条件

  • Max 800 characters per message
  • No URLs in message text
  • Sender name is optional and not visible to the recipient in most countries
  • 每条消息最多800个字符
  • 消息文本中不允许包含URL
  • 发件人名称为可选,在大多数国家/地区对收件人不可见

Optional Parameters

可选参数

When sending, you can also include:
  • sender
    (string) - Business/org name for regulatory purposes
  • replyWebhookUrl
    (string) - US only: URL to receive reply webhooks
  • webhookData
    (string) - Extra data passed to webhook (max 100 chars)
发送时还可以包含:
  • sender
    (字符串)- 用于合规目的的企业/组织名称
  • replyWebhookUrl
    (字符串)- 仅限美国:接收回复Webhook的URL
  • webhookData
    (字符串)- 传递给Webhook的额外数据(最多100个字符)

Error Handling

错误处理

  • success: false with
    error
    field describes the issue (e.g., invalid phone number, insufficient credits)
  • US/Canada numbers only work from US/Canada IP region
  • International numbers require E.164 format (e.g.,
    +44...
    )
  • Messages containing URLs are rejected — use descriptions instead
  • Max 800 characters — longer messages are rejected, not truncated
  • success: false并带有
    error
    字段描述问题(例如无效电话号码、额度不足)
  • 美国/加拿大号码仅在美国/加拿大IP区域可用
  • 国际号码需要E.164格式(例如
    +44...
  • 包含URL的消息会被拒绝——请改用描述性内容
  • 最多800个字符——超过长度的消息会被拒绝,不会被截断