35

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

GabrieleMartini
  • 1,665
  • 2
  • 19
  • 26
Joan Sagué Flo
  • 361
  • 1
  • 3
  • 6
  • https://stackoverflow.com/a/54258584/15247307 Why isn't this a limitation with WhatsApp? – Dr. Harshad Ramineni Feb 20 '21 at 14:48
  • 1
    Whatsapp doesn't respect users' privacy and allows governments to crawl and store user's data easily. That's one of the reasons authoritarian regimes such as Iran have blocked Telegram but not Whatsapp. – Ali Hashemi Mar 02 '21 at 12:23

3 Answers3

35

Update (2022):

Links to phone numbers such as https://t.me/+1XXXXXXX will lead you to a web page the same as username links do, but you can only start chatting with the user if their privacy settings allows you.

Old answer:

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

Ali Hashemi
  • 3,158
  • 3
  • 34
  • 48
27

Welcome to StackOverflow.

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

Check Telegram blog for more info.

Major Sam
  • 547
  • 8
  • 16
11

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

https://t.me/+41794997040
https://wa.me/+41794997040
https://signal.me/#p/+41794997040

Feuermurmel
  • 9,490
  • 10
  • 60
  • 90
  • Is it possible to also add a message there? Are there similar ones for video/audio calls via Telegram? – android developer Aug 11 '22 at 08:51
  • @androiddeveloper Not that I would know of – Feuermurmel Aug 12 '22 at 12:29
  • Checking on the Contacts app by Google (when choosing a contact that has Telegram, and I have Telegram app), it seems that at least in the Android API it should be possible, but for some reason it doesn't work for me. Can you please see if I'm correct on this? – android developer Aug 13 '22 at 13:30
  • I've only looked at solutions that work cross-platform from a web-browser and not just within the ecosystem of a specific mobile OS, so I can't help you. – Feuermurmel Aug 15 '22 at 11:38