D
D
DmitryLife2019-08-17 12:55:39
PHP
DmitryLife, 2019-08-17 12:55:39

How to pass data from the tail of a link to the server?

Good afternoon.
I am writing a telegram bot. My task is to make a referral system. To do this, I need to transfer the referral data in the link.
As I understand it, the link should look like the following. like this:
t.me/Some_bot?start=refId
But how do I catch the "start" data?
Telegram sends data via WebHook, but the json response does not contain the necessary data.
Can anyone give me some pointers on what information to look into?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2019-08-17
@DmitryLife

But how do I catch the "start" data?

https://core.telegram.org/bots#deep-linking
Telegram bots have a deep linking mechanism that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.
Each bot has a link that opens a conversation with it in Telegram - https://telegram.me/. You can add the parameters start or startgroup to this link, with values ​​up to 64 characters long. For example:
Further look at the examples:
deep_linking.py
An example in python, but I think you will figure it out.
You need to process the /start handler.
Can you show me how you are trying to do it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question