Search code examples
twiliotwilio-api

Twilio - Call Recording Http authentication - not getting redirect url


I enabled HTTP Basic Authentication on my Twilio account under Voice->Settings->General

Then created a voice recording and was able to download it using my account SID & Auth Token

curl -X GET "https://api.twilio.com/2010-04-01/Accounts/ACxxx/Recordings/RExxx" \
-u ACxxx:xxx

I need to be able to access the recording from a web client, without exposing my Twilio Auth Token to the public. According to Twilio docs, I should get a redirect Url, when fetching the recording, but in my above curl example I don't.

https://support.twilio.com/hc/en-us/articles/223183748-Protect-Media-Access-with-HTTP-Basic-Authentication-for-Programmable-Messaging

Requests to fetch your media will redirect you to a secure URL that is only valid for 4 hours.

I get the same result (recording is downloaded) if I use Authorization header

curl -X GET "https://api.twilio.com/2010-04-01/Accounts/ACxxx/Recordings/RExxx" \
-H "Authorization: Basic xxx"

Any ideas, why I am not getting redirect Url mentioned in Twilio docs?


Solution

  • I opened a ticket with twilio support and they acknowledged there is no support for redirect urls with temporary tokens, for recordings.

    They recommended to use Auth tokens, but as I mentioned in the description, this is something I am not willing to do (expose auth tokens to UI)