Skip to main content

短信

短信是 POST https://api.verifik.co/v2/communication/sms,不是 GET。正文需要 phone 和以 + 开头的 countryCode。路由把 phoneGateway 设为 sms,因此不要发送该字段。可选 title 为 1 到 15 个字符,language 选择文案。账户所有者的令牌可以调用。员工需要 Smart Tools 的执行权限。

调用返回的内容​

  • phone 与 countryCode
  • 设为 sms 的 phoneGateway
  • status

使用场景​

  • 用短信发送登录验证码。
  • 使用国内号码加区号。
  • 让路由选择短信网关。

API 参考​

Endpoint​

POST https://api.verifik.co/v2/communication/sms

发送成功返回 phoneGateway 为 sms、状态为 sent。OTP 送达时计费。

Headers​

名称值说明
Content-Typeapplication/json请求格式
Acceptapplication/json响应格式
AuthorizationBearer <token>客户端 JWT

Parameters​

名称类型必填示例说明
phonestring是3001234567仅国内号码。不要包含区号。
countryCodestring是+57以 + 开头的区号。
titlestring否ACME可选发送方名称,1 到 15 个字符。
languagestring否es可选模板语言。

Request​

import axios from "axios";

const options = {
method: "POST",
url: "https://api.verifik.co/v2/communication/sms",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer <your_token>",
},
data: {
"phone": "3001234567",
"countryCode": "+57"
},
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error.response ? error.response.data : error.message);
}

Response​

{
"data": {
"phone": "3001234567",
"countryCode": "+57",
"phoneGateway": "sms",
"status": "sent"
},
"signature": {
"dateTime": "November 27, 2026 12:00 PM",
"message": "Certified by Verifik.co"
}
}

说明​

  • 本路由是 POST,不是 GET。
  • phone 和 countryCode 必填。countryCode 必须以 + 开头。
  • 不要发送 phoneGateway;路由会把它设为 sms。
  • 在 Authorization 头中发送 Bearer JWT。
  • JSON 示例只说明字段形状。实际调用返回你所发送数值对应的记录。
  • 不要发送绕过缓存的标志。本页只记录客户端参数。

沙盒​

场景参数结果
数据源有记录phone: "3001234567", countryCode: "+57"短信 OTP 发出时为 200。
缺少必填值Omit phone409 MissingParameter。
未知的值countryCode: "57"countryCode 不以 + 开头时为 409。

401 when the bearer token is missing or rejected.