Yodlee cobrand登录不允许成功登录

时间:2017-06-10 20:02:11

标签: curl command-line-interface yodlee

我正在尝试学习yodlee开发者门户网站。我已注册,现在正在cobrand登录的入门。我试图像文档中那样提出请求。使用正确的参数获得cobrand上下文的正确方法是什么?

$querystring = "INSERT INTO responses VALUES('1', '2', '3', '4'); INSERT INTO responses    VALUES('1', '2', '3', '4')";

if (mysqli_multi_query($db, $querystring)) {
do {
   if (!mysqli_more_results($db)) {
    exit();
   }
} while (mysqli_next_result($db));
}
echo "end";

之后我想也许这些参数被命名为错误并试图改变它们但是这确实会作为一个错误的请求回来。

➜  perceptor git:(develop) http -f POST https://developer.api.yodlee.com/ysl/restserver/v1/cobrand/login cobrandLogin=sbCobxxxxxxxxxx cobrancdPassword=xxxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxxxx 

HTTP/1.1 401 Unauthorized
Content-Encoding: gzip
Content-Type: application/json;charset=UTF-8
Date: Sat, 10 Jun 2017 19:44:44 GMT
Server: Unknown
Transfer-Encoding: chunked
Vary: Accept-Encoding
yodlee-ref-id: m1497123885400E4t27g000000NLVYi-1

{
    "errorCode": "Y001", 
    "errorMessage": "loginName and password required", 
    "referenceCode": "u1497123885399Y4O27X"
}

更新信息

我能够在json结构的@Krithik建议之后让cobrand登录工作。

➜  perceptor git:(develop) http -f POST 
cobrandLogin=sbCobxxxxxxxxxx cobrancdPassword=xxxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxxxx        

HTTP/1.1 400 Bad Request
Connection: close
Content-Encoding: gzip
Content-Type: application/json;charset=UTF-8
Date: Sat, 10 Jun 2017 19:45:17 GMT
Server: Unknown
Transfer-Encoding: chunked
Vary: Accept-Encoding
yodlee-ref-id: H1497123917473U4x26Z000000NLJYR-1

{
    "errorCode": "Y800", 
    "errorMessage": "Invalid value for cobrandParam", 
    "referenceCode": "p1497123917471e4n26B"
}

我仍然无法完成用户登录部分。我试图运行这个。使用{ "cobrand": { "cobrandLogin": "xxxxxxxxxxxxx", "cobrandPassword": "xxxxxxxxx-xxxxxxxx-xxxxxxxxxx-xxxxxxx", "locale": "en_US" } } 和json结构。

$COBRAND=Authorization: {cobrandSession=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}

再次更新

如下所示更改用户登录结构将成功登录。

{
    "cobrandName": "Name of the cobrand",
    "loginName": "sbMemxxxxxxxxxxxxxxx", 
    "password": "xxxxxxxxxxxxxxxxxxxx"
}

➜  perception-ai git:(develop) ✗ http POST https://developer.api.yodlee.com/ysl/restserver/v1/user/login $COBRAND < user_login.json -vvv  
POST /ysl/restserver/v1/user/login HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Authorization: {cobSession=xxxxxxxxxxxxxxxxxxxxxxxxxx}
Connection: keep-alive
Content-Length: 126
Content-Type: application/json
Host: developer.api.yodlee.com
User-Agent: HTTPie/0.9.6

{
    "cobrandName": "Name of the cobrand", 
    "loginName": "sbMemxxxxxxxxxxxxx", 
    "password": "xxxxxxxxxxxxxxxxx"
}

HTTP/1.1 401 Unauthorized
Content-Encoding: gzip
Content-Type: application/json;charset=UTF-8
Date: Mon, 12 Jun 2017 21:09:18 GMT
Server: Unknown
Transfer-Encoding: chunked
Vary: Accept-Encoding
yodlee-ref-id: y1497301758768V4x26C000000NLsYs-1

{
    "errorCode": "Y001", 
    "errorMessage": "loginName and password required", 
    "referenceCode": "w1497301758768O4L26p"
}

2 个答案:

答案 0 :(得分:3)

请使用 -

进行cobrand登录

{     &#34; cobrand&#34;:{       &#34; cobrandLogin&#34;:&#34; xxxxxxxxxxxx&#34;,       &#34; cobrandPassword&#34;:&#34; xxxxxxxxxxxx&#34;,       &#34; locale&#34;:&#34; en_US&#34;      } }

CURL命令:

卷曲-X POST \   URL / v1 / cobrand / login \

-d&#39; {     &#34; cobrand&#34;:{       &#34; cobrandLogin&#34;:&#34; xxxxxxxxxxxxxxxxx&#34;,       &#34; cobrandPassword&#34;:&#34; xxxxxxxxxxxxxxx&#34;,       &#34; locale&#34;:&#34; en_US&#34;      } }&#39;

希望这有帮助。

答案 1 :(得分:0)

用户登录必须如下所示 -

  

{       “user”:{         “loginName”:“sbMemxxxxxxxx3”,         “密码”:“sbMemxxxxxxxxxxxx3”,         “locale”:“en_US”        }}

确保在请求标头中传递授权,它必须看起来像这样 -

  

授权:cobSession =“要在此处粘贴的Cobrand会话令牌值”

希望这有帮助。

此致

Krithik

相关问题