Zalo
Zalo over API

Zalo over API

Zalo messages

Infobip supports Zalo through its dedicated API. Use the Infobip Zalo API to send notification messages to your customer base. Upon registering templates to use for your communication, proceed in using the Zalo API message method to formulate your request.

You can send multiple template messages in a single API request. Remember to add supplementary options to your send request in case you would like to benefit from our additional features.

Message options

Additional message options can be applied to your API request.

Scheduling messages

Every communication can be scheduled. You can set astart date, time and time zone. This feature comes in handy when you don’t want to disturb your customers during the night, or you want to send messages only during a specific period for optimal conversion.

json
 
    "SendAt": 2015-07-07T17:00:00.000+01:00
 

An additional scheduling option is to set sending speed limit. For example, you can limit the sending speed when sending messages in bulk to deliver messages over a longer period of time. This feature can be beneficial when you expect recipients to react to your call-to-action embedded within the dispatched message. In that way you could avoid overwhelming your system or agents with an influx of responses from end customers and avoid operational strain. You can set the number (amount) of messages that will be sent periodically. Available time units are: m inutes, hours, days.

json
 
    "sendingSpeedLimit":  { "amount": 30, "timeUnit": "HOUR" }
 

You can also set a specific message delivery window outside of which messages won’t be delivered. You can set start time (hour/minute), end time (hour/minute) and days of the week. Time is expressed in the UTC time zone.

json
 
    "deliveryTimeWindow": {"days": [	"MONDAY",	"TUESDAY",	"WEDNESDAY",	"THURSDAY",	"FRIDAY",	"SATURDAY",	"SUNDAY"	],"from": {	"hour": 6,	"minute": 0	},"to": {	"hour": 15,	"minute": 30	}}
 

Validity period

There is a specific time period for messages during which the system will try to deliver them. For example, when you want to send a message to your audience and some users have their cell phones turned off, the system will retry delivery to these users until the validity period passes. The default and also the maximum validity period is 48 hours. It does not need to be set for each request. If you want to set a shorter period, you should define it under Validity period. Available time units are: **seconds, minutes, hours.**Default value is minutes.

json
 
    "validityPeriod":  { "amount": 30, "timeUnit": "MINUTES" }
 

SMS Failover

Add a failover to SMS option in case your Zalo message does not reach the end user within the defined period. You can also set a validity period for the SMS message.

json
 
    "smsFailover":  { "sender": "41793026726", "text": "Failover message text", "validityPeriod":  { 	"amount": 2, 	"timeUnit": "HOURS" 	} }	 
 

Platform

Zalo API works seamlessly with CPaaS X. This gives you greater flexibility in managing your configurations and resources in whatever manner that suits your needs. For more information about CPaaS X, refer to our CPaaS X documentation.

json
 
    "platform": {"entityId": "priorityCustomer","applicationId": "clientTestEnvironment"}
 

Encryption

Use encryption to encode the message content before transmitting it for processing. Encrypted content will be re translated on Zalo side.  All template values need to be encrypted using Cipher Type: RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING and Base64 encoded! Please use the RSA key generated by "Get existing RSA key" or "Create a new RSA key" methods while encrypting messages.

json
 
    "encrypted": true
 

Webhooks

Use the webhooks > delivery > url parameter option if you want users to be able to set the URL where they want to receive API responses. Define the URL under the webhooks parameter of the API request.

json
 
    "webhooks": {"delivery": {	"url": "https://www.example.com/zalo"	},}
 

Zalo Delivery Reports

This method allows you to get one-time delivery reports for sent Zalo messages.

Zalo Logs

This method allows you to get logs for Zalo messages. None of the query parameters is mandatory for this request. Any combination of parameters can be used to filter results. Some examples are shown below.

Zalo logs are available for the last 48 hours!

Zalo RSA encryption

Zalo Send API supports sending encrypted Zalo Notification Service message. To be able to encrypt the content of the Zalo message you need to first generate a public key.

Step 1: Generate RSA key

Use the RSA key generated by "Create a new RSA key" or "Get existing RSA key" methods while encrypting messages.

Create a new RSA key

The RSA key generation API allows you to generate a key pair consisting of a public key and a private key. Only the public key will be returned by this method. The private key will be stored by Zalo to decrypt the content.

Get existing RSA key

In case you've already generated an RSA key, please use the public key get API to get the public key.

Step 2: Encrypt templateData

The public key you received in step 1 will be in the form of a string. Please use Base64 encoding to convert public key to byte array format. Cipher Type when encode: RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING

all template values need to be encrypted using Cipher Type: RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING and Base64 encoded!

Use the public key to encrypt all template values using Cipher Type: RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING and encode Base64.

Step 3: Send encrypted content

Send encrypted content using our Zalo Send API with encrypted parameter set to true.

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use