I want to send MP3 file in telegram with my bot but some files return 400 error.
foe example this url
http://www.dl.noisera.com/files/musics/1586023395/introhanditdown.mp3
is not send and return 400 error but this url
http://www.dl.noisera.com/files/musics/1586023929/hardknocklifeghettoanthem.mp3
is send.
my api code is:
$url = 'https://api.telegram.org/bot'.$bot_id.'/sendDocument?chat_id='.$chat_id.'&document=http://www.dl.noisera.com/'.$_POST["musicFile"];
file_get_contents($url);
what is problem?
Telegram servers have cache problems, it takes a few hours for new links to be found by their servers. You should manually download the file with your server and upload it when you get that error.
Related
When I try to send such a photo, I get an error:
example:
bot.send_photo(message.chat.id, photo=test.webp)
but i use links (hope it doesn't affect)
ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: wrong type of the web page content"
You have to specify the proper path of the file.
photo_url <- "https://www.gstatic.com/webp/gallery/1.webp"
bot.send_photo(message.chat.id, photo=photo_url)
I'm trying to retrieve the asset info from a specific collection using the asset endpoint.
Example:
https://api.opensea.io/api/v1/asset/0x1a92f7381b9f03921564a437210bb9396471050c/2000/?format=json
Now, if you open that on your browser, it works flawlessly, but on your app or postman it just gives a 403 error by CloudFlare.
This is not a 401 error and we shouldn't need an API key for this.
So what is going on and how do I fix this? Any ideas?
Created azure logic app HTTP request it gives response for normal JSON schema However, I want to attach SharePoint excel sheet when I trigger the request from Postman.
1.How to used content type or schema to download the attached file. when postman request sent.
2.is that possible to download when you hit API through logic app
3.Generated HTTP POST URL is working
For your requirement, I test it in my side. It seems we do not need to set any value for "Content-Type" in headers of response. Please refer to my logic app below:
Then when you request the logic app url in postman, please choose "Send and Download" instead of "Send".
After that, you can download the file when request the url in postman.
In POSTMAN when i POST a URL with Headers with Body data it is working fine and getting Response as 200,but when i POST the same in J meter HTTP API request i am receiving the following Error.
Headers size in bytes: 124
Body size in bytes: 54
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 404
Response message: Resource Not Found
If you're sending the same requests you should be getting the same responses. HTTP Status Code 404 means that URL path is not correct so you need to check the path of your URL as most probably there is a difference there. Even non-printable characters which you cannot see in JMeter GUI are encoded into their equivalents so whitespace becomes %20 so pay attention to literally everything.
In any case given you can successfully execute the request in Postman it means that you can record it using JMeter's HTTP(S) Test Script Recorder
Prepare JMeter for recording, the easiest way is using JMeter Templates Feature
once JMeter creates a Test Plan for your - expand and start the HTTP(S) Test Script Recorder
Prepare Postman for recording, configure it to use JMeter as the proxy:
Run your request in Postman
That's it, JMeter should capture the request and save it under the Recording Controller along with the HTTP Header Manager containing corresponding request headers
I have a short video (about 6 seconds) and I want to post it to a service in Thingworx, where the service has a parameter of type Blob. I tried to post the Video using Postman client but I always have a 403 error; where the request is legal but the server refuses to respond to it. Could you help me please finding the right way to upload the video files?
Postman request
Postman request
enter image description here