I'm trying to send a PDF from a Telegram BOT.When I select a file from my server , it shows this message:
Client error: `POST https://api.telegram.org/botXXXX/sendDocument` resulted in a `400 Bad Request` response:\n {"ok":false,"error_code":400,"description":"Bad Request: wrong file identifier/HTTP URL specified"}\
But when I choose from other servers, it works fine!
my file is this directory :
http://109.169.XX.XX:7070/pdfs/sample.pdf
Should the server port be 80?
code :
$data=[
'chat_id' =>'YYYYY' ,
'caption' =>'test' ,
'document'=>"http://109.169.xx.xx:7070/pdfs/sample.pdf",
];
$url = 'https://api.telegram.org/bot' . $token . '/sendDocument';
$client= new \GuzzleHttp\Client([]);
$result = client->post( $url,['form_params'=>$data]);
.pdfreturn when opening it? (Content-Typeheader)