我创建了一个新的开发人员帐户,我在使用REST API进行身份验证时遇到了问题。
POST https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/coblogin
{ cobrandLogin: 'sbCob*****',
cobrandPassword: '**********' }
系统响应:
{ Error: [ { errorDetail: 'Internal Core Error has occurred' } ] }
我做错了吗?
答案 0 :(得分:1)
我正在使用Postman测试API,显然我需要使用x-www-form-urlencoded
发送参数以使其正常工作。使用默认form-data
会导致上述错误。
答案 1 :(得分:1)
require 'rest-client'
module Yodlee
def self.login_to_yodlee
site = self.site_resource
login_hash = {
cobrandLogin: 'yourlogin',
cobrandPassword: 'yourpassword'
}
begin
response = site["/authenticate/coblogin"].post login_hash, :'content-type' => 'application/x-www-form-urlencoded'
puts response
rescue RestClient::ResourceNotFound => ex
raise Exception.new(ex.response)
rescue Exception => ex
raise Exception.new(ex)
end
end
def self.site_resource
RestClient::Resource.new('https://rest.developer.yodlee.com/services/srest/restserver/v1.0')
end
end
Yodlee.login_to_yodlee
答案 2 :(得分:0)
通常,当您未正确提供输入参数的名称时会出现此错误;虽然在上面提到的代码中我可以看到它们都是正确的。我建议你请仔细检查输入参数名称(区分大小写)。而且要提到的是你应该将它作为两个不同的参数发送,即'cobrandLogin'和cobrandPassword。