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
You can authenticate with Twilio's API using the Account ID as the username and the primary or secondary auth token. If the primary token is compromised, you can promote the secondary token to the primary token which will make the old primary token unusable.
Your account's test credentials can be found on the API Keys & Tokens page in Console. Scroll down to the Auth Tokens section to see your Test Credentials.
Access the Account -> API keys and tokens page in Console. Scroll down to the "Auth Tokens" section, and then click Request a secondary token. In the pop-up dialog box, click Request Token. Click the Eye icon to view your new secondary token, and use it to update your existing Twilio applications.
The Twilio REST API allows you to query metadata about your account, phone numbers, calls, text messages, and recordings. You can also do some fancy things like initiate outbound calls and send text messages.
It seems there are a few causes for this error. I discovered I receive an "Authenticate" error when my account funds have been depleted. When I added funds, it worked again without any problems.
This same problem happened to me. I had made some successful API requests and reached a stopping point in my App, and I decided to publish to GitHub. Moments later I tried running my App, and my server was crashing when I made my Twilio API requests; and the console was saying I needed to authenticate. It turns out I had not added my .env
to the .gitIgnore
and I unknowingly published my accountSid to GitHub. Twilio sensed this and immediately suspended my accountSid. I am waiting for them to generate a new accountSid for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With