anatol
anatol

Reputation: 1760

Implement ReplyKeyboardMarkup in POST url

How to implement ReplyKeyboardMarkup in POST qwery for sendMessage method?

https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup= ..... ?

Upvotes: 2

Views: 2278

Answers (1)

Vahid Msm
Vahid Msm

Reputation: 1082

If you want to pass json as parameters in URL, you should encode it. So a URL like this:
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup={"keyboard": [["Button"]]} changes to:
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup=%7B%22keyboard%22%3A+%5B%5B%22Button%22%5D%5D%7D You can use online URL encoder/decoder like this one.

More information on URL encoding: https://en.wikipedia.org/wiki/Percent-encoding

Upvotes: 4

Related Questions