skip to Main Content

sendDocument via Telegram bot – Telegram API

sendDocument requires multipart/form-data. $path = 'C:file.txt' $userId = 12345 $token = "ABC123" $url = "https://api.telegram.org/-/sendDocument?chat_id=+" [net.servicepointmanager]::securityprotocol = 'ssl3,tls,tls11,tls12' $url = $url.Replace("-",$token).Replace("+",$userId) $Response = Iwr -Uri $url -Method Post -InFile $path -ContentType "multipart/form-data" $Response.Content But i got Error:400. How to properly…

VIEW QUESTION
Back To Top
Search