4
votes

I'm trying to identify each user by some unique key, which is added to /start command. For each user, I will generate some key, and show URL to the user. This is described step by step in the official documentation https://core.telegram.org/bots#deep-linking

Link for the users is in the format:

https://telegram.me/ExampleBot?start=uniqueKey

It works perfectly in the telegram app. The probem is, that when opened in the browser, only button "Start" is visible. When the user clicks, the uniqueKey is not send to the bot.

How to add a uniqueKey to /start command to make it work in telegram web app too? How should look like the generated URL? So user can just click, and does not need to write the code?

1
You can't create bot without a Human account. And every account can only have 20 bots quota. - Sean
Thanks, that what I was afraid of. So I need to use core.telegram.org/api#telegram-api instead of telegram bot api? - Petr Adam
Make your uniqueKey as Base64 and test again. - RAM
Looks like, it works :-), thanks, just need to do more tests! Now I see, it's stated in the documentation "We recommend using base64url to encode parameters with binary and other types of content." - Petr Adam
@RAM post it as an answer, I will then accept the answer and give you the bounty - Petr Adam

1 Answers

1
votes

Make your uniqueKey as Base64 and test again...

Based on Telegram documents it is recommended to using base64url to encode parameters with binary and other types of content.