立即开始
工作原理 功能特点 定价
SMS API
Cheapest SMS API Cheap SMS gateway Free SMS API Long SMS API 比较 集成 博客 常见问题 Google Play 登录 立即开始

集成

通过一次 API 调用从任何语言或平台发送短信。复制代码,替换 YOUR_API_KEY,即可使用。

发送短信

一次 API 调用即可从您的手机发送短信。选择您的语言:

curl -X POST https://mysmsgate.net/api/v1/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+15551234567", "message": "Hello from MySMSGate!"}'
import requests

resp = requests.post(
    "https://mysmsgate.net/api/v1/send",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"to": "+15551234567", "message": "Hello from MySMSGate!"}
)
print(resp.json())  # {"success": true, "sms_id": 1, "status": "pending"}
const resp = await fetch("https://mysmsgate.net/api/v1/send", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({to: "+15551234567", message: "Hello from MySMSGate!"})
});
const data = await resp.json(); // {success: true, sms_id: 1, status: "pending"}
$ch = curl_init("https://mysmsgate.net/api/v1/send");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "to" => "+15551234567",
        "message" => "Hello from MySMSGate!"
    ])
]);
$response = json_decode(curl_exec($ch), true);
payload, _ := json.Marshal(map[string]string{
    "to":      "+15551234567",
    "message": "Hello from MySMSGate!",
})
req, _ := http.NewRequest("POST", "https://mysmsgate.net/api/v1/send", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
// HTTP 202: {"success": true, "sms_id": 1, "status": "pending"}
require 'net/http'
require 'json'

uri = URI("https://mysmsgate.net/api/v1/send")
req = Net::HTTP::Post.new(uri, {
  "Authorization" => "Bearer YOUR_API_KEY",
  "Content-Type"  => "application/json"
})
req.body = {to: "+15551234567", message: "Hello from MySMSGate!"}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body) # {"success"=>true, "sms_id"=>1, "status"=>"pending"}

无代码集成

使用 webhook 将 MySMSGate 连接到您喜欢的自动化平台。

Zapier

Use the Webhooks by Zapier action to send SMS from any Zapier trigger.

  1. Add a Webhooks by Zapier action (POST)
  2. URL: https://mysmsgate.net/api/v1/send
  3. Headers: Authorization: Bearer YOUR_API_KEY
  4. Body: {"to": "+1...", "message": "..."}

Make (Integromat)

Use the HTTP module to call the MySMSGate API.

  1. Add an HTTP > Make a request module
  2. Method: POST, URL: https://mysmsgate.net/api/v1/send
  3. Add header: Authorization: Bearer YOUR_API_KEY
  4. Body type: JSON, fields: to, message

n8n

Use the HTTP Request node in your n8n workflow.

  1. Add an HTTP Request node
  2. Method: POST, URL: https://mysmsgate.net/api/v1/send
  3. Authentication: Header Auth (Authorization: Bearer YOUR_API_KEY)
  4. Body: JSON with to and message

Google Sheets + Apps Script

Send SMS directly from a Google Sheet using Apps Script.

  1. Open Extensions > Apps Script
  2. Paste the code below
  3. Run sendSMS() or attach to a button
Google Apps Script
function sendSMS() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var phone = sheet.getRange("A2").getValue();
  var message = sheet.getRange("B2").getValue();

  var options = {
    method: "post",
    contentType: "application/json",
    headers: {"Authorization": "Bearer YOUR_API_KEY"},
    payload: JSON.stringify({to: phone, message: message})
  };
  var resp = UrlFetchApp.fetch("https://mysmsgate.net/api/v1/send", options);
  Logger.log(resp.getContentText());
}

API 参考

POST /api/v1/send

发送端点的所有参数:

| Field | Type | Required | Description | |-----------|--------|----------|------------------------------------------------| | to | string | Yes | Phone number (e.g. +15551234567) | | message | string | Yes | SMS text | | device_id | string | No | Device UUID. If omitted, uses first device. | | slot | int | No | SIM slot: 0 = SIM 1, 1 = SIM 2. Default auto. |

响应(HTTP 202):

{"success": true, "sms_id": 258, "status": "pending"}