验证cobrand

时间:2014-09-02 12:03:57

标签: yodlee

我创建了一个新的开发人员帐户,我在使用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' } ] }
我做错了吗?

3 个答案:

答案 0 :(得分:1)

我正在使用Postman测试API,显然我需要使用x-www-form-urlencoded发送参数以使其正常工作。使用默认form-data会导致上述错误。

enter image description here

答案 1 :(得分:1)

就我而言,这是通过根据http://developer.yodlee.com/Aggregation_API/Aggregation_Services_Guide/Aggregation_REST_API_Reference

更改内容类型来解决的
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。