{"id":1404,"date":"2018-02-07T20:30:44","date_gmt":"2018-02-07T20:30:44","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=1404"},"modified":"2018-02-07T20:30:44","modified_gmt":"2018-02-07T20:30:44","slug":"move-sms-notifications-to-kaizala","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/move-sms-notifications-to-kaizala\/","title":{"rendered":"Move SMS notifications to Kaizala"},"content":{"rendered":"<p>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.<\/p>\n<p>In Kaizala, all communication via APIs happens within the context of a group (<em>API endpoint cannot initiate a 1:1 conversation<\/em>). Broadly, there are 2 types of groups \u2013<\/p>\n<ul>\n<li><strong>Hierarchical group<\/strong>\u00a0\u2013 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.<\/li>\n<li><strong>Managed Hub and Spoke group \/ Public group<\/strong>\u00a0\u2013 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).<\/li>\n<\/ul>\n<p>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:<\/p>\n<ul>\n<li>Create a Hub and Spoke group \/ managed public group from Kaizala management portal at\u00a0<a href=\"https:\/\/manage.kaiza.la\/PublicGroups\/PublicGroups\">https:\/\/manage.kaiza.la\/PublicGroups\/PublicGroups<\/a><\/li>\n<li>Add the users you want to notify as subscribers to the group. There are 2 ways of doing this\n<ol>\n<li>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.<\/li>\n<li>Generate invite link and have users join the group by clicking the link<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>Kaizala API<\/h2>\n<p>Below is the API payload \/ contract to be used:<\/p>\n<table width=\"489\">\n<tbody>\n<tr>\n<td width=\"104\"><strong>Method<\/strong><\/td>\n<td width=\"385\">POST<\/td>\n<\/tr>\n<tr>\n<td width=\"104\"><strong>URL<\/strong><\/td>\n<td width=\"385\">{{endpoint-url}}\/v1\/groups\/{{public-group-id}}\/messages<\/td>\n<\/tr>\n<tr>\n<td width=\"104\"><strong>Request Headers<\/strong><\/td>\n<td width=\"385\"><\/td>\n<\/tr>\n<tr>\n<td width=\"104\"><strong>accessToken<\/strong><\/td>\n<td width=\"385\">{{access-token}}<\/td>\n<\/tr>\n<tr>\n<td width=\"104\"><strong>Content-Type<\/strong><\/td>\n<td width=\"385\">application\/json<\/td>\n<\/tr>\n<tr>\n<td width=\"104\"><strong>Request Body<\/strong><\/td>\n<td width=\"385\">{\nMessage:\u201dMessage to subscriber here\u201d,\nsubscribers:[\u00a0\u201c{{mobile-number}}\u201d\u00a0],\nsendToAllSubscribers:false\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Notes:<\/h2>\n<ul>\n<li>Elements in curly \/ squiggly\u00a0brackets need to be replaced\n<ul>\n<li><strong>endpoint-url<\/strong>\u00a0is present in the response to generate accessToken call.<\/li>\n<li><strong>public-group-id<\/strong>\u00a0is the group id of the Public Group you have created (screenshot below to help you with how to get group id).<\/li>\n<li><strong>access-token<\/strong>\u00a0is required for authentication. If you are not familiar, please refer to the previous blog\u00a0<strong>Getting started with Kaizala APIs<\/strong>.<\/li>\n<li><strong>mobile-number<\/strong>\u00a0is the number of the subscriber to whom the message is targeted.<\/li>\n<\/ul>\n<\/li>\n<li>Make sure the\u00a0<em><strong>sendToAllSubscribers<\/strong>\u00a0<\/em>field is set to false.<\/li>\n<li>The subscribers field is an array, so you can input a comma separated list of numbers to which the message is intended.<\/li>\n<li>If the subscribers array has a number that is not a subscriber, the request would fail.<\/li>\n<\/ul>\n<p>To get the group id, go to your group on\u00a0<a href=\"https:\/\/manage.kaiza.la\/\">https:\/\/manage.kaiza.la<\/a>\u00a0and select the identifier at the end of the URL as shown in the animation below.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1405\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2018\/06\/group-id.gif\" alt=\"GIF showing how to select the group ID\" width=\"652\" height=\"116\" \/><\/p>\n<h2>Kaizala Flow Connector<\/h2>\n<p>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.\u00a0<em>(Microsoft Flow is an online workflow service \u2013 you could read the blog<strong> Automating business process using Kaizala Flow connector<\/strong>)<\/em><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1406\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2018\/06\/flow-connector.png\" alt=\"Send text message to group dialog box\" width=\"602\" height=\"222\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2018\/06\/flow-connector.png 602w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2018\/06\/flow-connector-300x111.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/p>\n<p>Thank you for reading. Hope that was helpful. Please let me know what you think by adding a comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A lot of organizations and companies send SMS to their clients or employees to keep them notified. One common ask among Kaizala enthusiasts is how to use Kaizala instead. In this post, I will demonstrate how this can be achieved.<\/p>\n","protected":false},"author":69216,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[87],"class_list":["post-1404","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-kaizala"],"acf":[],"blog_post_summary":"<p>A lot of organizations and companies send SMS to their clients or employees to keep them notified. One common ask among Kaizala enthusiasts is how to use Kaizala instead. In this post, I will demonstrate how this can be achieved.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/1404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69216"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=1404"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}