Usage notes
QPS limit
You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.
Debugging
OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a Resource Access Management (RAM) user or RAM role the permissions to call this API operation. Description:
Operation: the value that you can use in the Action element to specify the operation on a resource.
Access level: the access level of each operation. The levels are read, write, and list.
Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
The required resource types are highlighted.
If the permissions cannot be granted at the resource level, "All resources" is used in the Resource type column of the operation.
Condition key: the condition key that is defined by the Alibaba Cloud service.
Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
cams:ModifyChatappTemplate | Write |
| None | None |
Request parameters
Parameter | Type | Required | Description | Example | ||||
Components | object [] | Yes | The components of the message template. | |||||
Type | string | Yes | The component type. Valid values:
Note In Viber message templates, media resources such as images, videos, and documents are placed in the HEADER component. If a Viber message contains both text and an image, the image is placed below the text in the message received on a device. | BODY | ||||
Text | string | No | The text of the message that you want to send. | hello chatapp | ||||
Format | string | No | The type of the media resource. Valid values:
| TEXT | ||||
Url | string | No | The URL of the media resource. | https://img.tukuppt.com/png_preview/00/10/24/1GygxVK3F4.jpg | ||||
FileName | string | No | The name of the document. Note If the Type sub-parameter of the Components parameter is set to HEADER and the Format sub-parameter is set to DOCUMENT, you can specify this parameter. | Introduction Video | ||||
Buttons | object [] | No | The buttons. You can specify this parameter only if you set the Type sub-parameter of the Components parameter to BUTTONS. | |||||
Type | string | Yes | The button type. Valid values:
| URL | ||||
Text | string | No | The text of the button. | Click | ||||
Url | string | No | The URL to which you are redirected when you click the URL button. | https://www.website.com/ | ||||
UrlType | string | No | The URL type. Valid values:
| dynamic | ||||
ThumbUrl | string | No | The thumbnail URL of the video in the Viber message template. | https://cdn.multiplymall.mobiapp.cloud/cloudcode/yc-165407506207478-165511576113195/20220905/ec5b9737-1507-4208-bb27-8da3958da961.jpg?x-oss-process=image/resize,w_100 | ||||
Duration | integer | No | The length of the video in the Viber message template. Valid values: 0 to 600. Unit: seconds. | 120 | ||||
FileType | string | No | The type of the document attached in the Viber message template. | docx | ||||
Language | string | Yes | The template language. For more information, see Language codes. | en | ||||
Example | object | No | The examples of variables that are used when you create the message template. | |||||
string | No | The values of the variables. Before you specify this parameter, the format of the value must be changed from JSON to String. | {"textVariable":"text"} | |||||
TemplateCode | string | Yes | The message template code. | 8472929283883 | ||||
CustSpaceId | string | No | The space ID of the RAM user within the independent software vendor (ISV) account. | 28251486512358**** | ||||
Category | string | No | The category of the Viber template. Valid values:
| text | ||||
TemplateType | string | No | The type of the message template. Valid values:
| VIBER | ||||
Response parameters
Parameter | Type | Description | Example | |
object | The response parameters. | |||
RequestId | string | The request ID. | 90E63D28-E31D-1EB2-8939-A9486641**** | |
Code | string | The error code.
| OK | |
Message | string | The error message. | None | |
Data | object | The returned result. | ||
TemplateCode | string | The template code. | 8472929283883 | |
TemplateName | string | The name of the template. | hello_whatsapp | |
AccessDeniedDetail | string | The details about the access denial. | None | |
Examples
Sample success responses
JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
"Code": "OK",
"Message": "None",
"Data": {
"TemplateCode": "8472929283883",
"TemplateName": "hello_world"
},
"AccessDeniedDetail": "None"
}Error codes
HTTP status code | Error code | Error message |
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. |
For a list of error codes, see Service error codes.