⚙️
Channel360
HomeSign InSign Up
  • 🏠ChannelMobile Docs
  • Quick Start
    • Channel360 API
    • AgentChat API
    • Channel360 Guide
      • Dashboard
      • Templates
        • Template Creation
        • Template Configuration
      • Groups
        • Deleting Groups
        • Managing Group Details
      • Campaign
        • Campaign Creation
        • Campaign Statistics
      • Subscribers
        • Managing Subscribers
        • Subscriber Profile
  • Whatsapp Business API
    • WABA Prerequisites
    • WhatsApp Account Health
  • Our Products
    • Products
      • AgentChat
      • SMS
      • Broadcasting
      • ChatBot
  • API Usage
    • Using the Channel360 V1.1 API
      • Notifications
      • Templates
        • Create Templates
        • Read / Get Templates
        • Update Templates
        • Delete Templates
      • Webhooks
      • Conversations
        • Send Interactive Messages
        • Send Text Message
        • Send Media Message
          • Send Video Message
          • Send Image Message
          • Send File Message
        • Get Conversation History
  • Reference
    • API Reference
      • AgentChat API
      • Channel360 V1.1 API
  • FAQs
    • General FAQs
    • Channel360 FAQs
      • Templates
      • Notification Status
    • Technical FAQs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API Usage
  2. Using the Channel360 V1.1 API

Notifications

Want are Notifications and how to use them

PreviousUsing the Channel360 V1.1 API NextTemplates

Last updated 3 months ago

Was this helpful?

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"
                     }
                  }
               ]
            }
         ]
      }
   }
}
{
   "destination":"{{mobileNumber}}",
   "message":{
      "type":"template",
      "template":{
         "name":"demowithtext",
         "language":{
            "policy":"deterministic",
            "code":"en"
         },
         "components":[
            {
               "type":"body",
               "parameters":[
                  {
                     "type":"text",
                     "text":"John"
                  },
                  {
                     "type":"text",
                     "text":"21 Castle Street"
                  }
               ]
            }
         ]
      }
   }
}
{
    "destination": "{{mobileNumber}}",
    "message": {
        "type": "template",
        "template": {
            "name": "qa_test_video_format",
            "language": {
                "policy": "deterministic",
                "code": "en_US"
            },
            "components": [
                {
                    "type": "header",
                    "parameters": [
                        {
                            "type": "video",
                            "video": {
                                "link": "https://channel360-template-tags.s3.af-south-1.amazonaws.com/2024-02-15T13%3A47%3A46.871Z-Zendesk%2BOverview%2BDemo.mp4"
                            }
                        }
                    ]
                },
                {
                    "type": "body",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "Sid"
                        }
                    ]
                }
            ]
        }
    }
}

For authentication message templates, the components array contains dynamic placeholders that must be populated with a unique {{AUTH_CODE}} at runtime. These placeholders ensure secure and personalised message delivery.

  • The {{AUTH_CODE}} should be inserted into the parameters section dynamically before sending.

  • The same {{AUTH_CODE}} should be used across all relevant components (e.g., body text and buttons).

{
    "destination": "{{mobileNumber}}",
    "message": {
        "type": "template",
        "template": {
            "name": "auth_template",
            "language": {
                "policy": "deterministic",
                "code": "en_US"
            },
            "components": [
                {
                    "type": "body",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "{{AUTH_CODE}}"
                        }
                    ]
                },
                {
                    "type": "button",
                    "sub_type": "url",
                    "index": "0",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "{{AUTH_CODE}}"
                        }
                    ]
                }
            ]
        }
    }

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.

  • What are Notifications?
  • Want to send Notifications?
  • Send Message
  • POSTSend a Notification
  • Send Notifications with an Image
  • POSTSend Notification With An Image
  • Send Notifications with Video
  • POSTSend Notification with a Video and Tags
  • Endpoint Details
  • Endpoint Description
  • Request Parameters
  • Response

Send a Notification

post

API call to Send a Notification

Path parameters
orgIdstringRequired
Body
destinationstringOptionalExample: +27618982358
Responses
201
Password Reset
application/json
post
POST /v1.1/org/{orgId}/notification HTTP/1.1
Host: www.channel360.co.za
Content-Type: application/json
Accept: */*
Content-Length: 168

{
  "destination": "+27618982358",
  "message": {
    "type": "template",
    "template": {
      "name": "none_button_test",
      "language": {
        "policy": "deterministic",
        "code": "en_US"
      },
      "components": []
    }
  }
}
201

Password Reset

{
  "notification": {
    "_id": "143d860c5f45c9674687"
  }
}

Send Notification With An Image

post

API call to Send a Notification with an Image

Body
destinationstringOptionalExample: +27618982358
Responses
201
Password Reset
application/json
post
POST /v1.1/org/orgId/notification HTTP/1.1
Host: www.channel360.co.za
Content-Type: application/json
Accept: */*
Content-Length: 347

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

Password Reset

{
  "notification": {
    "_id": "35d67t89c5f4779b6468"
  }
}

Send Notification with a Video and Tags

post

API call to Send a Notification with a Video and Tags

Body
destinationstringOptionalExample: +27618982358
Responses
201
Password Reset
application/json
post
POST /v1.1/org/:orgId/notification HTTP/1.1
Host: www.channel360.co.za
Content-Type: application/json
Accept: */*
Content-Length: 403

{
  "destination": "+27618982358",
  "message": {
    "type": "template",
    "template": {
      "name": "nontification_with_video_and_tag",
      "language": {
        "policy": "deterministic",
        "code": "en_US"
      },
      "components": [
        {
          "type": "header",
          "parameters": [
            {
              "video": {
                "link": "https://channel360-template-tags.s3.af-south-1.amazonaws.com/2024-02-15T13%3A47%3A46.871Z-Zendesk%2BOverview%2BDemo.mp4"
              }
            }
          ]
        },
        {
          "type": "body",
          "parameters": [
            {
              "text": "Sid"
            }
          ]
        }
      ]
    }
  }
}
201

Password Reset

{
  "notification": {
    "_id": "35d8640c5f45c9b6468733"
  }
}