Move SMS notifications to Kaizala

SMS to Kaizala migration

A lot of organizations / companies send SMS to their clients / employees to keep them notified. One common ask among Kaizala enthusiasts is how to cut use Kaizala instead. In this post, I will demonstrate how this could be achieved.

In Kaizala, all communication via APIs happens within the context of a group (API endpoint cannot initiate a 1:1 conversation). Broadly, there are 2 types of groups –

  • Hierarchical group – which can either be part of a hierarchy / be standalone. But all contents posted in this group will be visible to all members of the group.
  • Managed Hub and Spoke group / Public group – where there are 3 kinds of users who can be part of the group: administrators, members and subscribers. Contents posted by admins / members would by default be visible to all subscribers. But, there is a provision to send a content directed to particular subscriber(s).

To send a notification to a particular user, we could leverage #2 above where we could send a text message / action directed to the user. Below are the steps involved:

  • Create a Hub and Spoke group / managed public group from Kaizala management portal at https://manage.kaiza.la/PublicGroups/PublicGroups
  • Add the users you want to notify as subscribers to the group. There are 2 ways of doing this
    1. On the group page, you could click on Manage Subscribers and select Add Subscribers from the menu. Upload a csv with the subscriber phone numbers.
    2. Generate invite link and have users join the group by clicking the link

Kaizala API

Below is the API payload / contract to be used:

Method POST
URL {{endpoint-url}}/v1/groups/{{public-group-id}}/messages
Request Headers
accessToken {{access-token}}
Content-Type application/json
Request Body {
Message:”Message to subscriber here”,
subscribers:[ “{{mobile-number}}” ],
sendToAllSubscribers:false
}

Note:

  • Elements in curly / squiggly brackets need to be replaced
    • endpoint-url is present in the response to generate accessToken call.
    • public-group-id is the group id of the Public Group you have created (screenshot below to help you with how to get group id).
    • access-token is required for authentication. If you are not familiar, please refer Getting started with Kaizala APIs.
    • mobile-number is the number of the subscriber to whom the message is targeted.
  • Make sure the sendToAllSubscribers field is set to false.
  • The subscribers field is an array, so you can input a comma separated list of numbers to which the message is intended.
  • If the subscribers array has a number that is not a subscriber, the request would fail.

To get the group id, go to your group on https://manage.kaiza.la and select the identifier at the end of the URL as shown in the animation below.

Group-id

Kaizala Flow Connector

In case you were using Microsoft Flow, you could use the Kaizala Flow connector, select the Show Advanced Options and enter the subscriber number in the Subscribers field. (Microsoft Flow is an online workflow service – you could read more at Automating business process using Kaizala Flow connector)

flow connector

 

Thank you for reading. Hope that was helpful. Please let me know what you think by adding a comment.

5 thoughts on “Move SMS notifications to Kaizala

  1. can we do something with the access token so that after 24 hours it automatically get updated in the client side
    actually what i am doing currently through api i am sending an action card to individual in a group by hitting api in another response card with the help of access token but after 24 hours it get invalid so what is the solution of this??

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s