Broadcast by Custom API

Introduction

So far, you must have broadcast using the same messages for all your customer contacts. However, what if you need a different message for each customer? Such as telling about specific information or certain schedules for different people.

In this guide, we will explain how to do it if you have your own customer database on your own server but you want to use them for broadcast in this application.

Preparation

First, you will have to prepare an endpoint of API on your own server and you need a developer/programmer for it. But what for? It is for allowing the program to request the broadcast data from your server and send them to your customers according to the data from your API.

Take a look at this example of an API endpoint from our server: https://unlimitedlinebroadcast.com/api/recipients/testopen in new window. Your API response must be like that in order to be processed by this application. These are the requirements for your API :

  1. HTTP Request method must be in "GETopen in new window"
    This endpoint https://unlimitedlinebroadcast.com/api/recipients/testopen in new window is a "GET" method. It should only include Query Stringsopen in new window and only be used to request data (they shouldn't include data like in the "POSTopen in new window" method).

  2. The response must be in JSONopen in new window string
    Your API response is required to be in raw JSON string with two root objects of "list" that contains your broadcast data and "next" that contains a paging token. The "list" is in the form of an array, each of which contains an object with property "uid" for the User ID of your customer and property "msg" for the broadcast messages. Take a look of our example in the below image for the response structure. enter image description here

  3. The Request headers are optional
    Your API does not require any additional Request Headersopen in new window to be used for broadcasts. However, we provide fields for request headers if your server does require additional headers such as authorization or server tokens.

  4. Your API must include a pagination system
    A pagination system is necessary for your response to prevent heavy load on our servers and your own servers too. The array data inside the "list" object must only contain less than 500 rows. In order to do that, you are required to include a 'next' object on the response root. It must contain your next page token, so the application will load the next set of data using that token. If your "next" object is empty or the API response is empty then it will automatically indicate that all of your data is done and ready to be processed for broadcast.

  5. Make sure your server code is running fine and is in a high-performance state
    If your API did not satisfy our requirements, it will pop an alert on your screen and you will be given information to fix your API. If you feel you have done it correctly but still having problems then please contact us and explain what you have done so that we will help you.

Using the API for broadcast

That's it! Now your API is ready to use in broadcast. So now we will give you an example of how to use it in the application. First, open the application window and change the recipients to "From API". Put your API endpoint to the endpoint field and also put some extra headers on the headers field if you need them. Please take a look at the demo below.

As you can see, the broadcast is done and the message reached all of the contacts in the API. Please contact us if you have any difficulty when using this feature.