Twilio REST API error - "Authenticate"

Sparky picture Sparky · May 10, 2012 · Viewed 9.5k times · Source

I'm getting the following error when I try to place calls using the Twilio REST API.

https://www.twilio.com/docs/api/rest

HTTP/1.1 401 Unauthorized 
Server: nginx 
Date: Thu, 10 May 2012 16:50:48 GMT 
Content-Type: application/xml 
Connection: close 
WWW-Authenticate: Basic realm="Twilio API" 
Etag: 
Last-Modified: 
Content-Length: 233 

401 Authenticate 20003 
http://www.twilio.com/docs/errors/20003

I googled, but found nothing. Anyone had this issue?

What I POSTed on the API call was:-

$url = 'https://api.twilio.com/2010-04-01/Accounts/ACdxxxxxxx/Calls';

From => +1415xxxxxx 
To => +1646xxxxx
Url => http://173.201.xx.xx/Test/Twilio/twilio_test.php

Answer

CaseySoftware picture CaseySoftware · May 10, 2012

(Twilio employee here.)

The 401 error is usually related to when you are supposed to authenticate but haven't or potentially an error occurred with it.

Can you provide the full snippet of code that you're using to place the call? Are you using one of our sample snippets or something else?