I use the TelegramBotPHP to work with Telegram Bot API: https://github.com/Eleirbag89/TelegramBotPHP
and this my code for build keyboard button :
$option = array(
array($telegram->buildKeyboardButton("Main"), $telegram->buildKeyboardButton("Help")) );
$keyb = $telegram->buildKeyBoard($option, $onetime=false,$resize=true);
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'parse_mode' => 'HTML', 'text' => "Main Menu");
$telegram->sendMessage($content);
The keyboard is working very well but when you back after a day to bot the keyboard is disappeared!