OMNI channel: Kakao AlimTalk example

Learn about the simple methods which will allow you to send messages and retrieve message reports using the Kakao AlimTalk and SMS communication channels.

In the following examples, we’ll show you how to configure the KakaoAlim-SMS failover scenario and send your first messages.

The messages will first be sent over Kakao AlimTalk communication channel. If the messages are rejected on Kakao AlimTalk (for example, the user doesn’t have Kakao installed or the user was not online in Kakao for longer than 3 days), the messages will be sent using the SMS communication channel. For each communication channel, a specific validity period can be set.

There are three easy steps to follow:

1. Create OMNI scenario

The first step is to create an OMNI scenario. In the OMNI scenario configuration, you need to define the OMNI steps which will be sequentially executed. The key parameters are channel and from, respectively identifying the communication channels and senders for each communication channel.

Prerequisites

To be able to send Kakao AlimTalk messages using the Infobip platform you need to configure Kakao service and obtain PlusFriend Id on Kakao Center. If you have any problem, please contact us.

POST /omni/1/scenarios HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{
  "name":"My KAKAO-A-SMS scenario",
  "flow": [
    {
      "from":"InfoKakaoAlim",
      "channel": "KAKAO_ALIM"
    },
    {
      "from": "InfoSMS",
      "channel": "SMS"
    }    
  ],
  "default": true
}	
  

Response format

If successful, the response header HTTP status code will be 200 OK and the scenario will be created, as shown in the example bellow.

If you try to create the scenario without authorization, you will receive a 401 Unauthorized error.

{
  "key": "CC9F01A5DC7BEE2C2B829D203482A654",
  "name":"My KAKAO-A-SMS scenario",
  "flow": [
    {
      "from": "InfoKakaoAlim",
      "channel": "KAKAO_ALIM"
    },
    {
      "from": "InfoSMS",
      "channel": "SMS"
    }    
  ],
  "default": true
}	
  

The key parameter needs to be stored as it will be used when sending the message.

Info

You can find more information about creating an OMNI scenario at: Scenario:// Create .

2. Send OMNI message

Once you’ve created an OMNI scenario (identified by the key parameter) as described in the previous chapter, you are ready to send your OMNI messages through defined Kakao AlimTalk and SMS communication channels. First, the Kakao AlimTalk message will be sent to the defined phoneNumber. If the message is rejected on Kakao or the end user doesn’t have the Kakao application installed, the message will be sent using the SMS communication channel.

For sending OMNI messages, you can use the advanced API method. Detailed descriptions about the advanced API method can be found here: OMNI:// Send an advanced message.

The parameters that should be set are scenarioKey, phoneNumber, templateName and text for the SMS failover as shown below.

TEMPLATE REGISTRATION

Kakao AlimTalk is used for sending template messages. For sending you will need to provide template code according to which message will be send. For template registration contact us. Registration process can take more than one day.

For the example bellow, the following template with the name MY_TEXT_TEMPLATE was registered:“Hi #{name}, this is Kakao AlimTalk text message.”, where #{name} is parameter and must be replaced with one or more words, otherwise message is not going to be sucessfully sent.

Text message

POST /omni/1/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{
	"scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654",
	"destinations": [{
		"to": {
			"phoneNumber": "41793026727"
		}
	}],
	"kakaoAlim": {
		"text": "Hi Infobip, this is Kakao AlimTalk text message.",
		"templateName": "MY_TEXT_TEMPLATE",
		"validityPeriod": 15
	},
	"sms": {
		"text": "This is the SMS failover message"
	}
}	
  

Response format

If successful, the response header HTTP status code will be 200 OK and the message will be sent.

If you try to send the message without authorization, you will receive a 401 Unauthorized error.

HTTP/1.1 200 OK
Content-Type: application/json

{   
    "messages":[   
       {   
            "to":{
              "phoneNumber": "41793026731"
            },
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 7,
                "name": "PENDING_ENROUTE",
                "description": "Message sent to next instance"
            },
            "messageId": "50c24400-124f-4678-9f4b-309e994a4deb"
        }
    ]
}	
  

3. Get Delivery Reports

Delivery reports are not supported.

Additional Examples

If you would like to send Kakao AlimTalk messages containing text and buttons please check the example provided below. The examples also shows how to configure the custom validity period for each communication channel. Template approval is required.

Parameter Type Description
text string Text of the message that will be sent. Max 1000 characters.
templateName string Template code. Max 20 characters.
buttons array Kakao AlimTalk buttons. Max 5 buttons.
buttonText string Kakao AlimTalk button label. Max 28 characters.
buttonUrl string

Kakao AlimTalk Call To Action. Should point to your landing page. Max 500 characters.

validityPeriod string The message validity period in minutes. When the period expires, the message will be automatically sent using the next OMNI step.

Buttons Kakao AlimTalk message

When sending Kakao AlimTalk buttons message, text, templateName, buttonText and buttonUrl are all mandatory! All fields need to match corresponding template fields!

Info

Default validity period in OMNI for Kakao AlimTalk messages is 24h and 48h for SMS messages.

Template registration

For sending message with buttons you will need to provide template code according to which message will be send. For template registration contact contact us. Registration process can take more than one day.

For the example bellow, the following template with the name MY_BUTTONS_TEMPLATE was registered with message text “Hi #{name}, this is Kakao AlimTalk buttons message.”, where #{name} is parameter and must be replaced with one or more words. ButtonText is registered display text for each button, and buttonUrl is registered link for each button. Button’s url and text must match.

POST /omni/1/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{
	"scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654",
	"destinations": [{
		"to": {
			"phoneNumber": "41793026727"
		}
	}],
	"kakaoAlim": {
		"text": "Choose between some options:",
		"templateName": "MY_BUTTONS_TEMPLATE",
		"validityPeriod": 15,
		"buttons": [{
				"buttonText": "Option 1",
				"buttonUrl": "http://my.server.com/kakao?answer=1"
			},
			{
				"buttonText": "Option 2",
				"buttonUrl": "http://my.server.com/kakao?answer=2"
			}
		]
	},
	"sms": {
		"text": "This is the SMS failover message"
	}
}	
  

If you have any additional questions please contact us.