title: how to get user_id from phone_number using Telegram Bot API
body: <p>I'm currently working on a Telegram Bot that gets user information in Telegram once you know a phone number. The main goal is to get all the user information stored in Telegram for a user, just knowing his/her phone_number.</p>
  
  <p>So, I have tried using the sendContact function as explained in the Telegram Bot API and like this post: <a href="https://stackoverflow.com/questions/41686463/how-to-get-user-id-of-a-phone-number-in-telegram">How to get user_id of a phone number in telegram</a></p>
  
  <p>The problem is that if I try to so this sending my own number as a contact to my chat_id, I receive the Contact structure, but if I send from the bot to myself another phone_number (which corresponds to another active Telegram account), I get no user_id in the JSON file. The problem is that I can just get an user_id, if I use the phone_number of the chat_id account, that means that I can't get any information about anyone using his phone number. But I have seen a lot of possible solutions, but none is working for me.</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>I'm using: 
  <code>https://api.telegram.org/bot&lt;BOT TOKEN&gt;/sendContact?chat_id=&lt;MY CHAT ID&gt;&amp;phone_number=&lt;PHONE_NUMBER I WANT TO KNOW USER_ID&gt;&amp;first_name=&lt;RANDOM NAME&gt;</code></p>
  
  <p>If use use my own chat_id to receive the message and my phone_number it works, whenever I use another phone_number it does not.</p>