Great question — answering as the UphillTech team:
On whatsapp you have two options (at least): Using the official API, you should use an Authentication template: https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/ If the official API doesn't match your needs, for whatever reason, you can use un-official clients. Such is the case, there's a high risk of getting flagged as spam for sending messages to un-known users. Then the option would be asking the end-users to request the code. If they are the ones starting the chat session, there's no reason to be flagged as spam. The same method would be also valid for Telegram, if you ask the user to request a OTP from a bot, then the bot would be able to...
Full answer by lu4t: https://stackoverflow.stackexchange.com/a/78974917 (CC BY-SA 4.0).
Need it done for your business? UphillTech.