All Products
Search
Document Center

Chat App Message Service:Send a Viber message to multiple phone numbers

Last Updated:Jan 20, 2025

API description

You can call SendChatappMassMessage to send a Viber message to multiple phone numbers.

You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

You can send messages to up to 1,000 phone numbers in a single request.

Debugging

You can call this operation in OpenAPI Explorer. OpenAPI Explorer automatically calculates the signature value and 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 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 displayed in bold characters.

    • 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 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:SendChatappMassMessage

Write

  • acs:cams::{#accountId}:*

None

None

Request parameters

Parameter

Type

Required

Description

Example

ChannelType

string

Yes

The type of the channel. Set the parameter to viber.

viber

TemplateCode

string

Yes

The template code.

744c4b5c79c9432497a075bdfca36bf5

Language

string

Yes

The language. For more information about language codes, see Language codes.

en

From

string

Yes

The mobile phone number of the message sender.

2***0

FallBackId

string

No

The ID of the fallback policy.

S00001

FallBackContent

string

No

The content of the fallback message.

Fallback text message

TaskId

string

No

The task ID

100000001

SenderList

object []

Yes

The mobile phone numbers of the message receivers.

To

string

Yes

The mobile phone number of the message receiver.

2***1

TemplateParams

object

No

The parameters of the template.

string

No

The parameters of the template.

{"param1":"value1","param2":"value2"}

CustSpaceId

string

No

The space ID of the RAM user.

28251486512358****

Ttl

long

No

The timeout period for sending messages. Unit: seconds. Valid values: 30 to 1209600.

50

Label

string

No

The type of the Viber message. Valid values:

  • promotion

  • transaction

promotion

Tag

string

No

The tag information of the Viber message.

tag A

FallBackDuration

integer

No

Specifies the period of time after which the fallback message is sent if the message receipt that indicates the message is delivered to clients is not received. If this parameter is left empty, the fallback message is sent only when the message fails to be sent or the message receipt that indicates the message is not delivered to clients is received. Unit: seconds. Valid values: 60 to 43200.

120

FallBackRule

string

No

The fallback rule. Valid values:

  • undelivered: A fallback is triggered if the message is not delivered to clients. When the message is being sent, the template parameters are verified. If the parameters fail to pass the verification, the message fails to be sent. Whether the template and phone number are prohibited is not verified. By default, this value is used when FallBackRule is left empty.

  • sentFailed: A fallback is triggered even if the template parameters including variables fail to pass the verification. If the channelType, type, messageType, to, and from parameters fail to pass the verification, a fallback is not triggered.

undelivered

Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The ID of the request.

90E63D28-E31D-1EB2-8939-A9486641****

Code

string

The status code returned.

  • A value of OK indicates that the request is successful.

  • Other values indicate that the request fails. For more information, see Error codes.

OK

Message

string

The error message returned.

User not authorized to operate on the specified resource.

GroupMessageId

string

The ID of the message group.

890000010002****

AccessDeniedDetail

string

The details about the access denial.

None

Examples

Sample success responses

JSON format

{
  "RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
  "Code": "OK",
  "Message": "User not authorized to operate on the specified resource.",
  "GroupMessageId": "890000010002****",
  "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, visit the Service error codes.