这个问题通常是由于提供的Twilio账户凭据不正确造成的。请确保在Twilio提供的控制面板中使用正确的AccountSid和AuthToken。下面是正确设置Twilio客户端的代码示例:
require 'twilio-ruby'
# put your own credentials here
account_sid = 'YOUR_ACCOUNT_SID'
auth_token = 'YOUR_AUTH_TOKEN'
# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)
# alternatively, you can preconfigure the client like so
Twilio.configure do |config|
config.account_sid = account_sid
config.auth_token = auth_token
end
# then you can create a new client without parameters
@client = Twilio::REST::Client.new
# use the client to do fun stuff like send messages or make calls!
上一篇:API停止运行