I'm trying to learn the yodlee developer portal. I have signed up and now going the the Getting Started at the cobrand login. I have tried to do the request like they have in the documentation. What is the correct way to get the cobrand context with the correct params?
➜ 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"
}
Afterwards I thought maybe the params were named wrong and tried changing them but that really does come back as a Bad Request.
➜ 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"
}
I was able to get cobrand login to work following @Krithik advice on the json structure.
{ "cobrand":
{
"cobrandLogin": "xxxxxxxxxxxxx",
"cobrandPassword": "xxxxxxxxx-xxxxxxxx-xxxxxxxxxx-xxxxxxx",
"locale": "en_US"
}
}
I am still having trouble finishing the user login portion. I am trying to run this. With the $COBRAND=Authorization: {cobrandSession=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
and a json structure.
{
"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"
}
Changing the user login structure as below will be a successful login.
{
"user":
{
"cobrandName": "Name of the cobrand",
"loginName": "sbMemxxxxxxxxxxxxx",
"password": "xxxxxxxxxxxxxxx"
}
}
Please do a cobrand login using-
{ "cobrand": { "cobrandLogin": "xxxxxxxxxxxx", "cobrandPassword": "xxxxxxxxxxxx", "locale": "en_US" } }
CURL command:
curl -X POST \ URL/v1/cobrand/login \
-d '{ "cobrand": { "cobrandLogin": "xxxxxxxxxxxxxxxxx", "cobrandPassword": "xxxxxxxxxxxxxxx", "locale": "en_US" } }'
Hope this helps.