Kakao ChinguTalk example

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

The messages will first be sent over Kakao ChinguTalk communication channel. If the messages are rejected on Kakao (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 the channel and from, respectively identifying the communication channels and senders for each communication channel.

Prerequisites

To be able to send Kakao ChinguTalk 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-C-SMS scenario",
  "flow": [
    {
      "from":"InfoKakaoChingu",
      "channel": "KAKAO_CHINGU"
    },
    {
      "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-C-SMS scenario",
  "flow": [
    {
      "from": "InfoKakaoChingu",
      "channel": "KAKAO_CHINGU"
    },
    {
      "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 ChinguTalk and SMS communication channels. First, the Kakao ChinguTalk message will be sent to the defined phoneNumber. If, for some reason, the message is rejected on the 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 the scenario key and phoneNumber (JSON object where the keys are names of parameters in the template) text for the SMS failover as shown below. Field isPromotional is not mandatory and by default is set to false.

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"
		}
	}],
	"kakaoChingu": {
		"text": "Hello from Kakao talk!",
		"validityPeriod": 15,
		"isPromotional": true

	},
	"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 ChinguTalk messages containing text, images or buttons please check the example provided below. The examples also shows how to configure the custom validity period for each communication channel. It’s possible to send text with image message or buttons message.

Send Image KakaoChingu message

Parameter Type Description
text string

Text of the message that will be sent. Max 1000 characters.

imageURL string URL of the image sent in the KakaoChingu message. Max 500 characters.
isPromotional boolean Indicates if content is of promotional character.
validityPeriod string The message validity period in minutes. When the period expires, the message will be automatically sent using the next OMNI step.

Image Kakao ChinguTalk message

When sending a image Kakao ChinguTalk message, imageUrland text are mandatory!

For sending image it’s mandatory to register image and obtain Kakao image url. For image registration contact contact us.

Image must be png/jpg and max 500kB. Recommended size is 720px x 720px.

Info

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

Image Kakao ChinguTalk message request example:

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

{
	"scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654",
	"destinations": [{
		"to": {
			"phoneNumber": "385993466926"
		}
	}],
	"kakaoChingu": {
		"text": "Check out this image:",
		"validityPeriod": 15,
		"imageUrl": "http://my.server.com/kakao/image.png"
	},
	"sms": {
		"text": "This is the SMS failover message"
	}
}	
  

Send Buttons Kakao ChinguTalk message

Parameter Type Description
text string

Text of the message that will be sent. Max 1000 characters.

buttons array KakaoChinguTalk buttons. Max 5 buttons.
buttonText string Kakao ChinguTalk button label. Max 28 characters.
buttonUrl string Kakao ChinguTalk Call To Action. Should point to your landing page. Max 500 characters.
isPromotional boolean

Indicates if content is of promotional character.

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 ChinguTalk message

When sending a buttons KakaoChingu message, text, buttonText and buttonUrl are all mandatory!. Only url buttons are supported.

Buttons Kakao ChinguTalk message request example:

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

{
	"scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654",
	"destinations": [{
		"to": {
			"phoneNumber": "385993466926"
		}
	}],
	"sms": {
		"text": "Fallback sms text"
	},
	"kakaoChingu": {
		"text": "Choose between some options:",
		"validityPeriod": 15,
		"buttons": [{
				"buttonText": "Option 1",
				"buttonUrl": "http://my.server.com/kakao/image.png"
			},
			{
				"buttonText": "Option 2",
				"buttonUrl": "http://my.server.com/kakao/image.png"
			}
		]
	}
}	
  

If you have any additional questions please contact us.