Viber API Documentation7.3.0

Docs / Tools / Keyboard Examples

Keyboard Examples

Examples of keyboard layouts.

Restaurants

Smoking / non smoking

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 3,
		"Rows": 2,
		"Text": "<font color=\"#494E67\">Smoking</font><br><br>",
		"TextSize": "medium",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"ActionType": "reply",
		"ActionBody": "Smoking",
		"BgColor": "#f7bb3f",
		"Image": "https: //s12.postimg.org/ti4alty19/smoke.png"
	}, {
		"Columns": 3,
		"Rows": 2,
		"Text": "<font color=\"#494E67\">Non Smoking</font><br><br>",
		"TextSize": "medium",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"ActionType": "reply",
		"ActionBody": "Non smoking",
		"BgColor": "# f6f7f9",
		"Image": "https: //s14.postimg.org/us7t38az5/Nonsmoke.png"
	}]
}

Food types

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>ASIAN</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "ASIAN",
		"BgColor": "#f7bb3f",
		"Image": "https://s18.postimg.org/9tncn0r85/sushi.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>FRENCH</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "French",
		"BgColor": "#7eceea",
		"Image": "https://s18.postimg.org/ntpef5syd/french.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>MEXICAN</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "Mexican",
		"BgColor": "#f6f7f9",
		"Image": "https://s18.postimg.org/t8y4g4kid/mexican.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>ITALIAN</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "Italian",
		"BgColor": "#dd8157",
		"Image": "https://s18.postimg.org/x41iip3o5/itallian.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>INDIE</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "Indie",
		"BgColor": "#f6f7f9",
		"Image": "https://s18.postimg.org/wq06j3jkl/indi.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><font color=\"#494E67\"><b>MORE</b></font>",
		"TextSize": "large",
		"TextHAlign": "center",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "More",
		"BgColor": "#a8aaba",
		"Image": "https://s18.postimg.org/ylmyu98et/more_Options.png"
	}]
}

Restaurant listing

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 2,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "Zepras_image",
		"BgColor": "#f6f7f9",
		"Image": "https://s14.postimg.org/pireym5h9/Restaurant01.png"
	}, {
		"Columns": 4,
		"Rows": 2,
		"Text": "<br><b>\u00A0\u00A0ZEPRAS</b><br>\u00A0\u00A0Minimum: 100 \u20BD Delivery: 10 \u20BD<br>\u00A0\u00A012:00 - 23:30<br>\u00A0\u00A0aprox. delivery time: 90 min.<br>\u00A0\u00A0Rating: 4 stars, 760 reviews",
		"TextSize": "regular",
		"TextHAlign": "left",
		"TextVAlign": "top",
		"ActionType": "reply",
		"ActionBody": "Zepras_text",
		"BgColor": "#f6f7f9"
	}, {
		"Columns": 2,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "Giraffa_image",
		"BgColor": "#f6f7f9",
		"Image": "https://s14.postimg.org/otdojdb99/Restaurant02.png"
	}, {
		"Columns": 4,
		"Rows": 2,
		"Text": "<br><b>\u00A0\u00A0Giraffa</b><br>\u00A0\u00A0Minimum: 55 \u20BD Delivery: 10 \u20BD<br>\u00A0\u00A012:00 - 23:45<br>\u00A0\u00A0aprox. delivery time: 120 min.<br>\u00A0\u00A0Rating: 4.5 stars, 1300 reviews",
		"TextSize": "regular",
		"TextHAlign": "left",
		"TextVAlign": "top",
		"ActionType": "reply",
		"ActionBody": "Giraffa_text",
		"BgColor": "#f6f7f9"
	}]

}

Games

Selection

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "purple_flower",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/fvaegniyf/Game1.png"
	}, {
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "green_flower",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/df8l2t0vr/Game2.png"
	}, {
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "green_mushroom",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/u4a0ypxh3/Game3.png"
	}, {
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "cactus",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/c2vhenstz/Game4.png"
	}, {
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "blue_pink_flower",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/srwxakpfb/Game5.png"
	}, {
		"Columns": 1,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "greenish_flower",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/knot5u307/Game6.png"
	}, {
		"Columns": 6,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "mud",
		"BgColor": "#e0e0e0",
		"Image": "https://s15.postimg.org/huvllt2nr/longbutton.png"
	}]
}

Quiz

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 2,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "salmon",
		"BgColor": "#e0e0e0",
		"Image": "https://s22.postimg.org/es631qrq5/salmon.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "flamingo",
		"BgColor": "#e0e0e0",
		"Image": "https://s22.postimg.org/67crakhjx/flamingo.png"
	}, {
		"Columns": 2,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "snakes",
		"BgColor": "#e0e0e0",
		"Image": "https://s22.postimg.org/r82svhl25/snake.png"
	}]
}

News

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><br><br><br><br>\u00A0\u00A0\u00A0<font color='#ffffff'>Politics</font>",
		"TextHAlign": "left",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "clinton_image",
		"BgColor": "#ffffff",
		"Image": "https://s9.postimg.org/mebu960yz/politics.png"
	}, {
		"Columns": 4,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "clinton_text",
		"BgColor": "#ffffff",
		"Text": "\u00A0\u00A0\u00A0<b>Clinton and Trump Begin <br>\u00A0\u00A0\u00A0 Final Sprint to Election Day </b><br><br>\u00A0\u00A0\u00A0Hillary Clinton \"Allergic\" to Trump<br><br><font color=#999999'>\u00A0\u00A0\u00A01 min. ago</font>",
		"TextHAlign": "left",
		"TextVAlign": "top"
	}, {
		"Columns": 2,
		"Rows": 2,
		"Text": "<br><br><br><br><br>\u00A0\u00A0\u00A0<font color='#ffffff'>Sports</font>",
		"TextHAlign": "left",
		"TextVAlign": "middle",
		"ActionType": "reply",
		"ActionBody": "serena_image",
		"BgColor": "#ffffff",
		"Image": "https://s9.postimg.org/ok653o4ff/sports.png"
	}, {
		"Columns": 4,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "serena_text",
		"BgColor": "#ffffff",
		"Text": "\u00A0\u00A0\u00A0<b>Serena Williams: World No .1 <br>\u00A0\u00A0\u00A0surpasses Federer's record </b><br><br>\u00A0\u00A0\u00A0Wiliams breaks grand slam record<br><br><font color=#999999>\u00A0\u00A0\u00A02 hours ago</font>",
		"TextHAlign": "left",
		"TextVAlign": "top"
	}]
}

E-commerce

{
	"Type": "keyboard",
	"Buttons": [{
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion1",
		"BgColor": "#e0e0e0",
		"Text": "<font color=’#807b78’>5.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/484u3tg89/cream_01.png"
	}, {
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion2",
		"BgColor": "#e0e0e0",
		"Text": "<font color=’#807b78’>7.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/k7s3141nt/cream_02.png"
	}, {
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion3",
		"BgColor": "#e0e0e0",
		"Text": "<font color=’#807b78’>9.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/9m87p3vc9/cream_03.png"
	}, {
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion4",
		"BgColor": "#e0e0e0",
		"Text": "<font color=’#807b78’>12.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/5r4tmjc6h/cream_04.png"
	}, {
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion5",
		"BgColor": "#e0e0e0",
		"Text": "<font color=’#807b78’>19.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/y5a96ezqh/cream_05.png"
	}, {
		"Columns": 1,
		"Rows": 2,
		"ActionType": "reply",
		"ActionBody": "lotion6",
		"BgColor": "#e0e0e0",
		"Text": "<br><font color=’#807b78’>23.99 \u20BD</font>",
		"TextHAlign": "center",
		"TextVAlign": "bottom",
		"Image": "https://s12.postimg.org/6vyvrwynd/cream_06.png"
	}, {
		"Columns": 6,
		"Rows": 1,
		"ActionType": "reply",
		"ActionBody": "lotion_promotion",
		"BgColor": "#e0e0e0",
		"Text": "<font color=#ffffff>\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0HOLIDAY SEASON SPECIAL OFFERS<br>\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0GET IT NOW FOR ONLY </font><font color=#e897ad>29.99\u20BD</font>",
		"TextHAlign": "left",
		"TextVAlign": "middle",
		"Image": "https://s13.postimg.org/5b8k7118z/image.png"
	}]
}