Tuesday
I'm trying to request a Twilio recording file using Workato's HTTP request. But, I'm getting the following error:
400 Bad Request
<?xml version='1.0' encoding='UTF-8'?>
<TwilioResponse><RestException><Code>20001</Code><Message>Bad request</Message><MoreInfo>https://www.twilio.com/docs/errors/20001</MoreInfo><Status>400</Status></RestException></TwilioResponse>
Below is my request:
{
"request_name": "Request recording file",
"request": {
"method": "GET",
"content_type": "application/json",
"url": "https://api.twilio.com/2010-04-01/Accounts/A_______________________0/Recordings/R___________________..."
},
"response": {
"output_type": "rawdata",
"ignore_http_errors": "false"
}
"wait_for_response": "false"
}
I've got the "Response content type" set to Binary and the Encoding to UTF-8. What am I missing?
Thank you in advance.
BK
Solved! Go to Solution.
8 hours ago
My issue was that I didn't include in the Request Header the Header name = Content-Type and Value = audio/mpeg. Dumb.
So, for others to get this to work using the HTTP action I used the following settings for our recording which are dual channel:
Request
Method = Get
Request URL = https://api.twilio.com/2010-04-01/Accounts/{accountID}/Recordings/{mediaID}.mp3
Parameter = RequestedChannels: 2
Request Header = Content-Type: audio/mpeg
Response
Response content type: Binary
Encoding: UTF-8
Hope this helps
8 hours ago
My issue was that I didn't include in the Request Header the Header name = Content-Type and Value = audio/mpeg. Dumb.
So, for others to get this to work using the HTTP action I used the following settings for our recording which are dual channel:
Request
Method = Get
Request URL = https://api.twilio.com/2010-04-01/Accounts/{accountID}/Recordings/{mediaID}.mp3
Parameter = RequestedChannels: 2
Request Header = Content-Type: audio/mpeg
Response
Response content type: Binary
Encoding: UTF-8
Hope this helps
6 hours ago
Oof, that is annoying. I've run into some case-sensitive headers in the past -- the worst! Glad you cracked it.