Notifications

Want are Notifications and how to use them

What are Notifications?

Notifications are immediate, one-way messages sent to users for timely information or updates.


Want to send Notifications?

This endpoint allows you to send notifications.

Send Message

Send Notifications with an Image

Send Notifications with Video

{
   "destination":"{{mobileNumber}}",
   "message":{
      "type":"template",
      "template":{
         "name":"demowithpicture",
         "language":{
            "policy":"deterministic",
            "code":"en"
         },
         "components":[
            {
               "type":"header",
               "parameters":[
                  {
                     "type":"image",
                     "image":{
                        "link":"https://media.newyorker.com/photos/59095bb86552fa0be682d9d0/master/w_2560%2Cc_limit/Monkey-Selfie.jpg"
                     }
                  }
               ]
            }
         ]
      }
   }
}

Just like in campaigns with their tags, the parameters must be defined for notification creation when there are parameters in the the template used.

Endpoint Details

  • HTTP Method: POST

  • Endpoint URL: https://www.channel360.co.za/v1.1/org/639700347749ed00181de224/notification

Endpoint Description

The provided endpoint is used to send a WhatsApp notification to a single recipient with the specified destination phone number and message content. This can be useful for sending individual notifications or updates via WhatsApp.

Request Parameters

Headers

  • Content-Type: Required. Set to application/json to indicate that the request body is in JSON format.

  • Authorization: Required. This header contains a bearer token for authentication. Replace 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' with your actual authentication token.

Request Body

The request body should be a JSON object containing the following properties:

  • destination: Required. The phone number of the recipient in international format (e.g., +27656225667).

  • message: Required. An object representing the WhatsApp message to be sent. It contains the following properties:

    • type: Required. Set to "template" to indicate that you are sending a template message.

    • template: Required. An object defining the template message with the following properties:

      • name: Required. The name of the template.

      • language: Required. An object specifying the language for the template with the following properties:

        • policy: Required. Set to "deterministic" to define the language policy.

        • code: Required. The language code (e.g., "en_US").

      • components: An array of message components. You can define message components within this array.

Response

The response from this endpoint will contain information about the status of the WhatsApp notification sent. You can access the response data in the .then block of your Axios request as shown in your code:

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });// Some code

Rate Limit

Channel360 is subject to rate limiting to maintain system stability and prevent abuse, spam, denial-of-service attacks, and related concerns. The rate limit for Channel360 is set at 10 messages per second. If this limit is exceeded, Channel360 will respond with a 429 Too Many Requests HTTP status code. Our aim is to establish rate limits that are sufficiently high to accommodate normal usage patterns while minimizing the likelihood of encountering limits. However, occasional spikes in usage may occur, making it unavoidable to encounter a rate limit.

To ensure uninterrupted service and prevent production outages, we recommend implementing 429 retry logic using exponential backoff and jitter when making API calls to Channel360. This approach involves progressively increasing the waiting time between retries, incorporating randomness to avoid synchronization issues. By following this retry strategy, you can handle rate limit responses effectively and maintain a smooth integration with Channel360.

Last updated