我一直收到这个错误:“757:意外的令牌在'无法验证您的访问级别的URL。您必须使用正确的凭据登录” 在我的Ruby on Rails应用程序。Plivo:尝试发送短信时出错
下面的代码:
def send_message_plivo
p = RestAPI.new(ENV["PLIVO_AUTHID"], ENV["PLIVO_AUTHTOKEN"])
params = {
"src" => "1111111111",
"dest" => "xxxxxxxxxxxxx", # <- my only verified number
"text" => "Hi! From Plivo",
"url" => "http://localhost:3000/sent_message_status",
"method" => "POST"
}
response = p.send_message(params) # <- line of the error!
puts response
end
你知道我缺少什么?
是真的假设为“dest”的参数吗?我在这里看到“dst”:https://www.plivo.com/docs/api/message/ –
对于PLIVO_AUTHID,你使用你的plivo用户名还是AUTH ID(20ish“random”字符串)? –
你是对的。我有问题的env变量,我直接把键,并将“dest”改为“dst”,它的工作! – ste