Skip to main content

WhatsApp 消息

WhatsApp 消息是 POST https://api.verifik.co/v2/communication/whatsapp,不是 GET。正文需要 phone 和 countryCode。路由把 phoneGateway 设为 whatsapp。可选 whatsappTemplate 为 authentication(默认)或 flow2。使用 flow2 时,language 选择 flow2_es 或 flow2_en,可选 title(1 到 15 个字符)是品牌区。

调用返回的内容​

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

使用场景​

  • 用 WhatsApp 发送登录验证码。
  • 需要品牌模板时选择 flow2。
  • 默认模板是 authentication。

API 参考​

Endpoint​

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

发送成功返回 phoneGateway 为 whatsapp、状态为 sent。

Headers​

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

Parameters​

名称类型必填示例说明
phonestring是3001234567仅国内号码。
countryCodestring是+57以 + 开头的区号。
whatsappTemplatestring否authentication可选。authentication(默认)或 flow2。
languagestring否es可选。使用 flow2 时选择 flow2_es 或 flow2_en。

Request​

import axios from "axios";

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

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": "whatsapp",
"status": "sent"
},
"signature": {
"dateTime": "November 27, 2026 12:00 PM",
"message": "Certified by Verifik.co"
}
}

说明​

  • 本路由是 POST,不是 GET。
  • whatsappTemplate 可选:authentication 或 flow2。
  • 路由把 phoneGateway 设为 whatsapp。
  • 在 Authorization 头中发送 Bearer JWT。
  • JSON 示例只说明字段形状。实际调用返回你所发送数值对应的记录。
  • 不要发送绕过缓存的标志。本页只记录客户端参数。

沙盒​

场景参数结果
数据源有记录phone: "3001234567", countryCode: "+57"WhatsApp OTP 发出时为 200。
缺少必填值Omit countryCode409 MissingParameter。
未知的值whatsappTemplate: "flow2", language: "es"language 为 es 时用 flow2 模板返回 200。

401 when the bearer token is missing or rejected.