當我嘗試使用Twilio REST API撥打電話時,出現以下錯誤。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
我用Google搜索,但一無所獲。任何人有這個問題?
我的API調用POST方法是什麼: -
$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
嗨,您需要使用您的帳戶Sid和驗證令牌驗證您的請求。看到這裏的curlopt_userpwd設置:http://php.net/manual/en/function.curl-setopt.php#98164 –
@KevinBurke謝謝,就是這樣。我通過curlopt_userpwd提供了Auth令牌,它工作。 – Sparky