I want to sent documents and photos with the Telegram API. Problem is, that once it's sent, it's cached in on there servers. But if my document changes, I send old versions. For the documentation says:
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
But I'm not sure how to implement this. I tried with the following, sending HTTPHEADER, but it's still sending the cached version :/
function sendPhoto($bot_id,$chat_id,$caption,$disable_notification,$photo_url)
{
$ch = curl_init('https://api.telegram.org/bot'.$bot_id.'/sendPhoto');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$param = array(
'chat_id' => $chat_id,
'caption' => $caption,
'parse_mode' => 'html',
'disable_notification' => $disable_notification,
'photo' => $photo_url
);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param));
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
Can someone help me please ? :)