简体   繁体   中英

How to create a link to contact specific phone number via Telegram?

So I found out I could use a link like this in HTML:

<a href="https://api.whatsapp.com/send?phone={{phone_number}}" target="_blank">WhatsApp</a>

in order to let a user contact {{phone_number}} directly from a webpage (via WhatsApp web).

My question is: how to do the same but instead of WhatsApp, via Telegram?

Thank you in advance

Welcome to StackOverflow.

You should create a link like https://telegram.me/YourUsername for that purpose.

Check Telegram blog for more info.

It's NOT possible to link to Telegram like this for a phone numbers so far, because every user MUST add the phone number to their contact list before they can send a message to them by phone number. This limitation is because of Telegram privacy policy and abuse prevention. In more details, if Telegram allow this type of linking, a malicious party can fetch a web page like https://t.me/+1XXXXXXX for every possible number without passing authentication. That's most probably why Telegram doesn't have such linking feature.

However, you can link to @username of a Telegram user if he/she has any:

https://t.me/username

It is now possible to create links to both Telegram and WhatsApp accounts using their associated phone numbers using these URLs:

https://t.me/+41794997040
https://wa.me/+41794997040

You can use this site callmeback.in . It generates direct links to WhatsApp or/and Telegram users, bots or channels. You can copy the link to the clipboard instantly and paste it into your document. Especially useful if the document supports rich formatting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM