cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get Twilio recording file via Workato HTTP action

JayMappus
Deputy Chef III
Deputy Chef III

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

1 ACCEPTED SOLUTION

JayMappus
Deputy Chef III
Deputy Chef III

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 

View solution in original post

6 REPLIES 6

JayMappus
Deputy Chef III
Deputy Chef III

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 

gary1
Executive Chef III
Executive Chef III

Oof, that is annoying. I've run into some case-sensitive headers in the past -- the worst! Glad you cracked it.