接口说明
本接口的单用户 QPS 限制为 250 次/秒。超过限制,API 调用会被限流,这可能会影响您的业务,请合理调用。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
ChannelType | string | 是 | 类型。
| viber |
Type | string | 是 | 消息类型。取值:
| template |
MessageType | string | 否 | 当 Type 为 message 时,指定消息的详细类型。
| text |
TemplateCode | string | 否 | 模板 Code。Type 为 template 时此字段必填。 | 744c4b5c79c9432497a075bdfca3**** |
Language | string | 否 | 模板语言。 Type 为template时此字段必填,详细语言代码列表,请参见语言代码。 | en |
From | string | 是 | 消息发送方号码。 说明 支持通过阿里云注册的Viber商家号码 | 2***9 |
To | string | 是 | 消息接收方号码。 | 861390000**** |
TemplateParams | object | 否 | 消息模板变量。 | |
string | 否 | 消息模板变量对应的实际值,参数格式为 JSON 格式。如果模板中存在变量,该参数为必填项。 | {"param1":"value1","param2":"value2"} | |
Content | string | 否 | 消息内容。
| {"text": "hello whatsapp", "link": "", "caption": "", "fileName": "" } |
FallBackId | string | 否 | 失败回落策略 ID。可以在控制台创建相关策略并查看。 | S_000001 |
FallBackContent | string | 否 | 失败回落消息内容。 | This is a fallback message. |
CustSpaceId | string | 否 | 子账户空间 ID。 | 28251486512358**** |
TrackingData | string | 否 | Viber 消息跟踪数据值。 | tracking_id:123456 |
Label | string | 是 | Viber 消息类型,当 ChannelType=viber时为必填,取值:promotion 或 transaction。 | promotion |
Ttl | integer | 否 | Viber 消息发送超时时间,单位:秒,取值范围 30~1209600。 | 50 |
Tag | string | 否 | Viber消息发送时tag信息。 | tag |
TaskId | string | 否 | 任务 ID | 100000001 |
FallBackDuration | integer | 否 | 消息在指定时间内没有返回已到达回执时回落,时间单位为秒,最小值为 60,最大值 43200。 不填代表不根据此时间判断回落,仅发送失败和有失败的状态报告时才会回落。 | 120 |
FallBackRule | string | 否 | 回落规则。 说明 取值范围
| undelivered |
返回参数
名称 | 类型 | 描述 | 示例值 |
object | 返回数据。 | ||
RequestId | string | 请求 ID。 | 90E63D28-E31D-1EB2-8939-A94866411B2O |
Code | string | 请求状态码。
| OK |
Message | string | 错误提示信息。 | User not authorized to operate on the specified resource. |
MessageId | string | 消息 ID。 | 61851ccb2f1365b16aee**** |
示例
正常返回示例
JSON格式
{
"RequestId": "90E63D28-E31D-1EB2-8939-A94866*******",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"MessageId": "61851ccb2f1365b16aee****"
}错误码
HTTP status code | 错误码 | 错误信息 |
400 | Product.Unsubscript | You have not subscribed to the specified product. |
400 | Ram.PermissionDeny | You are not authorized to perform the operation. |
400 | System.LimitControl | The system is under flow control. |
400 | Unknown.ResourceOwnerId | The resource does not belong to the current user. |
访问错误中心查看更多错误码。