'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



Solution 1:[1]

Welcome to StackOverflow.

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

Check Telegram blog for more info.

Solution 2:[2]

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

Solution 3:[3]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Major Sam
Solution 2 Ali Hashemi
Solution 3