1

I am trying to write a simple program in PHP to use telegram api, (not bot api, main messaging api). when i run my script, result is 404 error. Why?

<?php
$postfields = array();
$postfields['phone_number'] ='+1234567890';
$postfields['sms_type'] ='0';
$postfields['api_id'] ='12345';
$postfields['api_hash'] ='abcdefghijklmnopqrstuvwxyz';
$postfields['lang_code'] ='en';
$url = '149.154.167.40:443';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
echo $html=curl_exec($ch);
curl_close($ch);
?>

tanks a lot.

best_code
  • 11
  • 1
  • 1
  • 5
  • I'm from Germany. How I should hash the values? – best_code Mar 28 '16 at 21:43
  • Sorry because telegram this Russian, Vkontakte, I think about you from Russian. https://core.telegram.org/api/obtaining_api_id You read api documentation? https://core.telegram.org/api . I think you use wrong api_hash for you. – Naumov Mar 28 '16 at 21:49
  • No problem! yes,I use wrong api_hash.But i do not undrestand the layer 5, 8, 16 and ...(https://core.telegram.org/method/auth.sendCode) – best_code Mar 28 '16 at 22:12
  • You configuration self accaunt in telegram api? – Naumov Mar 28 '16 at 22:19
  • Yes.i have api_id, api_hash and lang_code values. – best_code Mar 28 '16 at 22:22
  • @best_code start here: http://stackoverflow.com/questions/35536268/telegram-api-creating-an-authorization-key-404-error/35537654#35537654 – Charles Okwuagwu Mar 30 '16 at 20:00

0 Answers0