Skip to main content

Getting Started

Once your Viber channel is provisioned, sending your first message takes an API key and one API call. This page covers authentication, the base URL for your platform region, and two working requests: a free-form text message and a template message.


Prerequisitesโ€‹

Viber is not self-serve. Confirm each of the following is in place before you send.

RequirementHow to get it
8x8 Connect accountSign up at connect.8x8.com
Messaging subaccountRequested through your account manager. It must be a dedicated messaging subaccount, not an existing SMS subaccount
Viber channelProvisioned by 8x8 against a Viber Service ID once Viber approves your business sender. See Account Onboarding for what to submit
API keyGenerated in the Customer Portal at connect.8x8.com
SMS fallbackOptional. Configured by 8x8 as part of channel setup, including channel order and retry timing. Contact your account manager to enable it

๐Ÿ“˜

Already sending WhatsApp or RCS through the Messaging Apps API? The request envelope is identical here, only the content shape differs for Viber. Skip to Send Your First Message.


Authenticationโ€‹

The Messaging Apps API uses ApiKey Bearer Token authentication. Include your key on every request:

Authorization: Bearer {apiKey}

Generate and rotate keys in the Customer Portal.


Base URLsโ€‹

Use the base URL matching the platform deployment region your account is provisioned in. Sending to the wrong region fails authentication.

Platform regionBase URL
Asia (default)https://chatapps.8x8.com
Europehttps://chatapps.8x8.uk
North Americahttps://chatapps.us.8x8.com
Indonesiahttps://chatapps.8x8.id

For more detail, see Platform Deployment Regions.


Send Your First Messageโ€‹

Send a free-form text message by posting to the messages endpoint for your subaccount:

curl -X POST "https://chatapps.8x8.com/api/v1/subaccounts/{subAccountId}/messages" \
-H "Authorization: Bearer {apiKey}" \
-H "Content-Type: application/json" \
-d '{
"user": {
"msisdn": "+6512345678"
},
"type": "text",
"content": {
"text": "Here is your booking reference: ABC1234."
}
}'

Replace {subAccountId} with your messaging subaccount and {apiKey} with your key.

๐Ÿ“˜

This free-form path is valid for promotional content. Transactional and OTP messages must use a registered template. See Viber Templates.


Send a Template Messageโ€‹

Transactional and OTP content must go through a registered template instead of free-form text. This example sends a one-time password using an approved otp_login_en template, with SMS fallback if the Viber send fails:

curl -X POST "https://chatapps.8x8.com/api/v1/subaccounts/{subAccountId}/messages" \
-H "Authorization: Bearer {apiKey}" \
-H "Content-Type: application/json" \
-d '{
"user": {
"msisdn": "+6512345678"
},
"type": "template",
"content": {
"template": {
"name": "otp_login_en",
"language": "en",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "name": "pin", "text": "1234" }
]
}
]
},
"fallbackText": "Your code is 1234. Team 8x8",
"sms": {
"source": "8x8"
}
},
"channels": [
{ "channel": "Viber", "channelId": "{viberChannelId}" }
]
}'

Replace {subAccountId}, {apiKey}, and {viberChannelId} with your own values, and otp_login_en with the name of a template you registered on this channel.

๐Ÿšง

Template send is rolling out and may not yet be available on your account. Contact your account manager to confirm availability. Before you send, confirm the template's status is Approved: a Pending or Declined template fails validation before 8x8 forwards the request to Viber. See Viber Templates.


Where to Go Nextโ€‹

If you want toRead
See all promotional message formats with screenshots and payloadsPromotional Message API Library
Send transactional or OTP trafficTransactional Message API Library
Receive replies and delivery receiptsWebhooks and Delivery Receipts
Understand how traffic is ratedBilling
Revisit the business case and full page mapViber Hub