-
Notifications
You must be signed in to change notification settings - Fork 6
Viber API mt
justin4515 edited this page Oct 31, 2024
·
37 revisions
通过API发起Viber号码消息发送服务
- URL:
https://api2.nxcloud.com/api/viber/mt
- Method:
POST
- Content-Type:
application/json
- 需要鉴权:
是
鉴权规则请参考地址:API接口调用约定
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
accessKey | String | 是 | fme2na3kdi3ki | 用户身份标识 |
ts | String | 是 | 1655710885431 | 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 |
bizType | String | 是 | 7 | Viber业务类型,取固定值“7” |
action | String | 是 | mt | Viber业务操作,取固定值“mt” |
sign | String | 是 | 6e9506557d1f289501d333ee2c365826 | API入参参数签名,签名算法 |
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
appkey | String | 是 | pem28kje | 应用appkey |
phone | String | 是 | 86158xxxx1795 | 消息接收方的Viber号码,需要带国码。如86158xxxx1795 |
functionType | String | 是 | text | Viber消息功能类型,消息支持以下功能类型的发送: 1. text 文本2. image 图片3. text_image 文本+图片4. text_image_button 文本+图片+按钮5. text_button 文本+按钮6. file 文件 7. video 视频 8. video_text 视频+文本9. video_text_button 视频+文本+按钮 |
messageData | JsonObject | 是 | 参照请求示例 | Viber消息体参数 |
- text:
- 参照text请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Transactional | 可用的计费类型(Transactional (验证码类型)/Session (会话类型)/ OtpTemplate (otp模板类型)) |
text | String | 否 | Your code is 989724. | 文本消息内容(当计费类型为Transactional /Session 时必填) |
templateId | String | 否 | c2cdc028-a48b-4187-bbaf-3aaa137b6e23 | 模板id(当计费类型为OtpTemplate 时必填) - 参照Otp模板说明
|
templateParams | JsonObject | 否 | {"code":"123456"} | 模板参数(当计费类型为OtpTemplate 时必填) - 参照Otp模板说明
|
templateLang | String | 否 | en | 模板语言(当计费类型为OtpTemplate 时必填) - 参照Otp模板语言说明
|
- image:
- 参照image请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)/Session (会话类型)) |
image | String | 是 | https://***.jpeg | 图片链接 |
- text_image:
- 参照text_image请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
text | String | 是 | Your code is 989724. | 文本消息内容 |
image | String | 是 | https://***.jpeg | 图片链接 |
- text_image_button:
- 参照text_image_button请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
text | String | 是 | Your code is 989724. | 文本消息内容 |
image | String | 是 | https://***.jpeg | 图片链接 |
buttonText | String | 是 | Click me | 按钮标题 |
buttonLink | String | 是 | http://www.viber.com |
按钮链接 |
- text_button:
- 参照text_button请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
text | String | 是 | Your code is 989724. | 文本消息内容 |
buttonText | String | 是 | Click me | 按钮标题 |
buttonLink | String | 是 | http://www.viber.com |
按钮链接 |
- file:
- 参照file请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Transactional | 可用的计费类型(Transactional (验证码类型)/Session (会话类型)) |
fileName | String | 是 | fileName.pdf | 文件名 |
fileLink | String | 是 | https://***.pdf | 文件链接 |
fileType | String | 是 | 文件类型(参照支持文件类型列表) |
- video:
- 参照video请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
thumbnail | String | 是 | https://***.jpeg | 视频缩略图 |
videoLink | String | 是 | https://***.mp4 | 视频链接 |
videoSize | Number | 是 | 1024 | 视频文件大小(单位:字节,不能超过200MB) |
duration | Number | 是 | 10 | 视频时间(单位:秒,不能超过600s) |
- video_text:
- 参照video_text请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
thumbnail | String | 是 | https://***.jpeg | 视频缩略图 |
videoLink | String | 是 | https://***.mp4 | 视频链接 |
videoSize | Number | 是 | 1024 | 视频文件大小(单位:字节,不能超过200MB) |
duration | Number | 是 | 10 | 视频时间(单位:秒,不能超过600s) |
text | String | 是 | Your code is 989724. | 文本消息内容 |
- video_text_button:
- 参照video_text_button请求示例
- messageData 参数:
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
rateType | String | 是 | Promotional | 可用的计费类型(Promotional (营销类型)) |
thumbnail | String | 是 | https://***.jpeg | 视频缩略图 |
videoLink | String | 是 | https://***.mp4 | 视频链接 |
videoSize | Number | 是 | 1024 | 视频文件大小(单位:字节,不能超过200MB) |
duration | Number | 是 | 10 | 视频时间(单位:秒,不能超过600s) |
text | String | 是 | Your code is 989724. | 文本消息内容 |
buttonText | String | 是 | Click me | 按钮标题 |
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "text",
"messageData": {
"rateType": "Transactional",
"text": "Your code is 989724."
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "image",
"messageData": {
"rateType": "Promotional",
"image": "https://***.jpeg"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "text_image",
"messageData": {
"rateType": "Promotional",
"text": "Your code is 989724.",
"image": "https://***.jpeg"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "text_image_button",
"messageData": {
"rateType": "Promotional",
"text": "Your code is 989724.",
"image": "https://***.jpeg",
"buttonText": "Click me",
"buttonLink": "http://www.viber.com"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "text_button",
"messageData": {
"rateType": "Promotional",
"text": "Your code is 989724.",
"buttonText": "Click me",
"buttonLink": "http://www.viber.com"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "file",
"messageData": {
"rateType": "Transactional",
"fileType": "pdf",
"fileName": "fileName.pdf",
"fileLink": "https://***.pdf"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "video",
"messageData": {
"rateType": "Promotional",
"thumbnail": "https://***.jpeg",
"videoSize": 882472,
"duration": 15,
"videoLink": "https://***.mp4"
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "video_text",
"messageData": {
"rateType": "Promotional",
"thumbnail": "https://***.jpeg",
"videoSize": 882472,
"duration": 15,
"videoLink": "https://***.mp4",
"text": "Your code is 989724."
}
}
body(application/json) 参数:
{
"appkey": "TexxxP6",
"phone": "791xxxxx730",
"functionType": "video_text_button",
"messageData": {
"rateType": "Promotional",
"thumbnail": "https://***.jpeg",
"videoSize": 882472,
"duration": 15,
"videoLink": "https://***.mp4",
"text": "Your code is 989724.",
"buttonText": "button text"
}
}
{
"code": 0,
"message": "Success",
"data": {
"requestId": "b81e8e9fcbbb422a813863e903de94bd"
},
"traceId": "77f8709b545f4fee93fd7f098be9df04"
}
{
"code": -1,
"message": "Failure",
"traceId": "77f8709b545f4fee93fd7f098be9df04"
}
code | message | 解决办法 |
---|---|---|
0 | Success | |
-1 | Failure | 请联系技术人员排除问题 |
1000~100X | Authentication failed | 详情查看API鉴权部分 |
1100 | Customer does not exist / Status is unavailable | 账号状态异常,联系业务人员处理账号问题 |
1102 | Insufficient balance | 账号余额不足,请联系业务人员充值 |
9000 | Request parameter error | 参数缺失,请检查必须的参数 |
9001 | System business error | 系统业务错误,请联系技术人员排除问题 |
9002 | Phone number error | 非法号码,请检查号码正确性 |
9003 | Customer APP does not exist / Status is unavailable | 应用状态异常,联系业务人员处理云平台应用创建/禁用问题 |
9004 | Customer APP does not have quotation | 应用报价缺失,联系业务人员处理应用报价问题 |
9005 | Missing customer APP routes | 应用路由缺失,请联系技术人员排查路由 |
9011 | Customer APP quotation currency error | 报价币种错误,请联系技术人员排查 |
9999 | Unknown error | 请联系技术人员排除问题 |
File Type | File Formats | Max File Size |
---|---|---|
Documents | .doc, .docx, .rtf, .dot, .dotx, .odt ,odf, .fodt, .txt, .info | 200MB |
.pdf, .xps, .pdax, .eps | 200MB | |
Spreadsheet | .xls, .xlsx, .ods, .fods, .csv, .xlsm, .xltx | 200MB |
说明:例如.doc格式,fileType填写doc;.xls格式,fileType填写xls
- 强制模板发送国家:俄罗斯(
RU
),乌克兰(UK
),白俄罗斯(BY
) - 计费规则:对于
text
类型消息,必须匹配Viber注册审核成功的模板,匹配成功,Transactional
计费;匹配失败,Promotional
计费。
- 会话开启
- 当终端用户主动发起对话,此时您发送会话类型的消息,将触发一个24小时的会话窗口
- 会话限制
- 在终端用户没有回应的情况下,最多连续发送5条会话类型消息。
- 单个会话限于向用户发送60条信息。
- 在达到60条信息的限制后,会话结束;如果用户回应,此时再发会话消息,一个新的会话将开始。
- 会话计费
- 开启会话,第一条会话消息按
Session
计费,后续会话期内Session
消息不计费。 - 没有开启会话的情况下,发会话消息统一都按
Promotional
计费。
模板id | 模板参数,括号后面是类型 | 模板英文示例 |
---|---|---|
1 | pin(String) | Your code is {{pin}}. Please don't share your code with ANYONE. We'll never call or message you and ask for it. |
2 | pin(String) | Your code is {{pin}}. It's valid for 5 minutes. Please don't share your code with ANYONE. We'll never call or message you and ask for it |
3 | pin(String)、 businessPlatformName(String) | {{business_platform_name}}: Your code is {{pin}}. Please don't share your code with ANYONE. We'll never call or message you and ask for it |
4 | pin(String)、codeValidityTime(int) | Your code is {{pin}}. It's valid for {{code_validity_time}} minutes. Please don't share your code with ANYONE. We'll never call or message you and ask for it. |
5 | pin(String)、pinType(String)、codeValidityTime(int) | Your {{pin_type}} code is {{pin}}. It's valid for {{code_validity_time}} minutes. Please don't share your code with ANYONE. We'll never call or message you and ask for it. |
6 | pin(String)、businessPlatformName(String)、codeValidityTime(int) | Your {{business_platform_name}} code is {{pin}}. It's valid for {{code_validity_time}} hours. Please don't share your code with ANYONE. We'll never call or message you and ask for it |
7 | pin(String)、pinType(String) | Your {{pin_type}} code is {{pin}}. Please don't share your code with ANYONE. We'll never call or message you and ask for it |
8 | pin(String)、businessPlatformActionName(String) | Your one-time password for {{business_platform_action_name}} is {{pin}}. Please don't share your code with ANYONE. We'll never call or message you and ask for it. |
9 | pin(String)、businessPlatformName(String)、codeReason(String) | {{business_platform_name}}: Your code is {{pin}}. You got this code because {{code_reason}}. Please don't share your code with ANYONE. We'll never call or message you and ask for it. |
语言 | 模板语言参数值 |
---|---|
Englis | en |
Arabic | ar |
Bulgarian | bg |
Croatian | hr |
Czech | cs |
Danish | da |
German | de |
Greek | el |
Spanish | es |
Finnish | fi |
French | fr |
Hebrew | he |
Burmese | my |
Hungarian | hu |
Indonesian | id |
Italian | it |
Norwegian | nb |
Dutch | nl |
Polish | pl |
Portuguese(Portugal) | pt |
Portuguese (Brazil) | br |
Romanian | ro |
Russian | ru |
Slovak | sk |
Serbian | sr |
Swedish | sv |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |
Persian | fa |
Belarusian | be |
Japanese | ja |
简介
短信
语音
- 上传语音录音文件
- 上传语音录音文件_v1
- 已上传录音文件查询
- 发送语音群呼
- 发送语音通知
- 发送语音验证码
- 语音验证码回填上报
- 语音回执回调
- 语音记录查询
- 上传语音录音文件-旧版本已废弃
- 发送语音群呼‐旧版已废弃
- 发送语音通知‐旧版已废弃
- 发送语音验证码‐旧版已废弃
- 语音回执回调‐旧版已废弃
云呼叫中心(NXLink)
- Web SDK
- Iframe集成
- 手动拨号通话记录查询
- 通过orderId查询
- 手动拨号记录回调
- 坐席信息查询
- 坐席状态查询
- 坐席状态信息查询
- 坐席组查询
- 坐席可用主叫查询
- 坐席组成员查询
- 坐席组更新成员
- 坐席效率统计
- 创建AICC外呼任务
- Webhook-手动外呼
云呼叫中心(AI自动外呼)
- Callbot API概述
- Callbot API鉴权
- Callbot 接口探活
- 创建自动拨号任务
- 批量添加拨打名单
- 创建自动拨号任务并添加拨打名单
- 任务控制(启动/暂停)
- 更新任务
- 获取通话列表
- 获取任务列表
- 获取拨打订单列表
- 停止订单拨打
- 查询订单维度拨打详情
- 通话维度回调
- 订单维度拨打回调
- 任务状态回调
- 批次-导出最新批次数据
- 批次-导入最新批次数据
Flash Call
短链
邮件验证码
DID号码
- DID号码进行短信下行V2
- DID短信结果回调(加签)
- DID短信结果回调(无加签)
- DID号码短信记录查询(新接口,未启用)
- DID号码通话记录查询
- DID呼出并转接到Amazon坐席
- DID呼出前与Connect号码绑定
通用
号码检测
- 发送消息
- 发送otp消息
- webhook
- 标记入站消息已读
- 上传媒体文件
- 获取媒体文件
- 删除媒体文件
- 查询号码信息
- 查询消息模板
- 创建消息模板
- 异步创建消息模板
- 编辑消息模板
- 删除消息模板
- 上传模板示例文件
- 嵌入式页面登录
- 创建客户应用
- 客户应用的号码列表
- 获取验证码
- 核验验证码
- flows-创建流
- flows-更新流
- flows-根据流ID查询流信息
- flows-根据whatsapp号码查询流列表
- flows-根据流ID查询流预览地址
- flows-查询流JSON
- flows-发布流
- flows-删除流草稿
- flows-废弃已发布的流
- flows-更新流JSON
- flows-上传业务公钥
- ads-根据公共主页ID查询绑定的数据集列表
- ads-根据数据集ID上报CAPI广告数据
Viber
Zalo ZNS
Super Message API
隐私号(旧)
PNS
坐席(旧版)
- NXphone PC 使用说明
- NXphone Android 使用说明
- NXphone Android SDK 接入文档
- 呼叫挂断原因解释
- 话单CDR查询接口
- 话单CDR回调接口说明(V1.0)
- 坐席API调用接口说明(V1.0)
- 根据orderid查询话单CDR接口
- 坐席系统sip链接调用方式(推荐)
- 号码脱敏处理
- 修改话机密码接口
- 查询审批单
- 查询话机
- WebRTC SDK使用说明
AI Agent