Adding an 'item' using the 'container method' - getting exception back - yodlee

I'm trying to add an item to content service, for a logged in user, using addItemForContentService1 . Prior to calling this API method I'm calling getLoginFormForContentService to get the login form for the specific content service. To the best of my knowledge, I've filled the data as required, taking all the fields from the form retrieved earlier, putting them into "credentialFields", only adding an attribute 'value' with the needed value (username / password), as provided by the user (my user/customer) for each field. Also, I've set the other fields in the input JSON as documented in the API reference.
The content service I work on is ETrade, content service id=24 (because I have a real account there that I can use).
Here are the POST parameters are captured using php's curl CURLOPT_VERBOSE option:
cobSessionToken=08062013_0%3A25553263f0443831be2f0c75dad28bc57896d59ac4aec35cf20‌​43ef186a65d2e726cd78d299d1b69cf06f64c606d7f89b2a9b6118ce24d9b438bdd70d24e82b1&use‌​rSessionToken=08062013_0%3Aec610a637dc6e59bd76214c3089e2459bf6b55f42b14d11dd836e3‌​59e2e8acd8e9f524e5ae50f21a0274c4e82a25f2f8ad799a8519d6947751dbab64fe3a4dea&conten‌​tServiceId=24&shareCredentialsWithinSite=true&startRefreshItemOnAddition=true&cre‌​dentialFields%5BenclosedType%5D=com.yodlee.common.FieldInfoSingle&credentialField‌​s%5B0%5D%5BvalueIdentifier%5D=LOGIN&credentialFields%5B0%5D%5BvalueMask%5D=LOGIN_‌​FIELD&credentialFields%5B0%5D%5BfieldType%5D%5BtypeName%5D=IF_LOGIN&credentialFields%5‌​B0%5D%5Bsize%5D=20&credentialFields%5B0%5D%5Bmaxlength%5D=40&credentialFields%5B0‌​%5D%5Bname%5D=LOGIN&credentialFields%5B0%5D%5BdisplayName%5D=User+ID&credentialFi‌​elds%5B0%5D%5BisEditable%5D=1&credentialFields%5B0%5D%5BisOptional%5D=0&credentia‌​lFields%5B0%5D%5BisEscaped%5D=0&credentialFields%5B0%5D%5BhelpText%5D=4736&creden‌​tialFields%5B0%5D%5BisOptionalMFA%5D=0&credentialFields%5B0%5D%5BisMFA%5D=0&crede‌​ntialFields%5B0%5D%5Bvalue%5D=XXX&credentialFields%5B1%5D%5BvalueIdentifier%5D=PASSWORD&credentialFields%5B1%5D%5B‌​valueMask%5D=LOGIN_FIELD&credentialFields%5B1%5D%5BfieldType%5D%5BtypeName%5D=IF_‌​PASSWORD&credentialFields%5B1%5D%5Bsize%5D=20&credentialFields%5B1%5D%5Bmaxlength‌​%5D=40&credentialFields%5B1%5D%5Bname%5D=PASSWORD&credentialFields%5B1%5D%5Bdispl‌​ayName%5D=Password&credentialFields%5B1%5D%5BisEditable%5D=1&credentialFields%5B1‌​%5D%5BisOptional%5D=0&credentialFields%5B1%5D%5BisEscaped%5D=0&credentialFields%5‌​B1%5D%5BhelpText%5D=12023&credentialFields%5B1%5D%5BisOptionalMFA%5D=0&credential‌​Fields%5B1%5D%5BisMFA%5D=0&credentialFields%5B1%5D%5Bvalue%5D=XXXX
I keep getting back an error:
Unknown Exception Occurred
reference code = _4c956ae5-bf4f-4d5a-801a-6abe752705d8
message = argument type mismatch
detailed value = Technical Difficulty Processing Request
I can't seem to find the reason for the problem. Can anyone assist?
Thanks!

Here is a request for Etrade which will work. Pass in the right credentials
"cobSessionToken": "xxxxx"
"userSessionToken": "xxxxxxx"
"contentServiceId": "24"
"credentialFields.enclosedType": "com.yodlee.common.FieldInfoSingle"
"shareCredentialsWithinSite": "true"
"startRefreshItemOnAddition": "false"
"credentialFields[0].displayName": "User ID"
"credentialFields[0].fieldType.typeName": "IF_LOGIN"
"credentialFields[0].helpText": "4736"
"credentialFields[0].maxlength": 40
"credentialFields[0].name": "LOGIN"
"credentialFields[0].size": 20
"credentialFields[0].value": "xxxx"
"credentialFields[0].valueIdentifier": "LOGIN"
"credentialFields[0].valueMask": "LOGIN_FIELD"
"credentialFields[0].isEditable": true
"credentialFields[1].displayName": "Password"
"credentialFields[1].fieldType.typeName": "IF_PASSWORD"
"credentialFields[1].helpText": "12023"
"credentialFields[1].maxlength": 40
"credentialFields[1].name": "PASSWORD"
"credentialFields[1].size": 20
"credentialFields[1].value": "xxxxx"
"credentialFields[1].valueIdentifier": "PASSWORD"
"credentialFields[1].valueMask": "LOGIN_FIELD"
"credentialFields[1].isEditable": true
"credentialFields[2].displayName": "Login with security device OR password"
"credentialFields[2].fieldType.typeName": "OPTIONS"
"credentialFields[2].helpText": "159365"
"credentialFields[2].maxlength": 40
"credentialFields[2].name": "OP_OPTION"
"credentialFields[2].size": 20
"credentialFields[2].value": "xxxxxx"
"credentialFields[2].valueIdentifier": "OP_OPTION"
"credentialFields[2].valueMask": "LOGIN_FIELD"
"credentialFields[2].isEditable": true
Please note that credentialFields[2] is an optional field and hence you can choose not to pass it.
Also please make sure to follow the refresh flow after this API call.

Related

Any extra field present in request body in laravel API

Suppose my API required following json in request
{
"name":"User Name",
"email":"user#email.com"
}
But user sending following json in request:
{
"name":"User Name",
"email":"user#email.com",
"phone":"1234467"
}
At controller side every thing works fine, validation performed on "name" & "email" and whole request is executed successfully. Where as the "phone" field is ignored silently without raising any flag.
The user never know that he/she had passed any extra field in request, which are not needed in request.
Is there any way to validated such scenario, like present of unknown field in request, like "phone"?
except() method could retrieve any other field present as array, and that is countable.
$excepts =$request->except(['email','name']);
if(count($excepts))
// do your stuff

Zapier basic auth pass blank data

I have been trying to create an app in Zapier for one of my project. On the very first step, I am doing Authentication where I choose "Basic Auth" method. I have set API URL along with details, however cannot see the expected result and seeing error in my API return value. After debugging, I found that API doesn't get the value I pass thru the Zapier. I have checked the same API in postman and it works, however it only doesn't work thru the Zapier.
Below is even more detail how I proceed, what is expected result and what I am getting:
Process we're following
We have created an App
We went to Authentication step, there we have selected “Basic Auth” option
Under the Basic Auth, we have configure with setting end point and method is “Post”
We have set our field names as Key and as value we have set “{{bundle.authData.password}” and “{{bundle.authData.username}}” in order to field mapping
Then came to Step 2 to test the authentication
Under the “Test Setup”, we have connected the current Zapier account and clicked on “Test Authentication”
This process doesn’t post any value in parameters. Hope I could explain the issue, please help us to find where we’re going wrong.
Expected Result
{
"data": {
"first_name": "Dhaval",
"last_name": "Parekh",
"email_address": "dhaval.php#gmail.com",
"phone_no": "1234567890",
"user_id": "7oiA****",
"token_id": "zNkzT***"
},
"resend_verification_link": false,
"status": true,
"message": "You have successfully Logged in!!"
}
Actual Result
{
"resend_verification_link": false,
"status": false,
"message": "The password must contain a minimum of one lower case character. one upper case character, one digit"
}
What I understand after spending too much time, is it doesn't send the data with post method and hence I'm getting this issue. While it works fine with the Get Method. So, should I consider that Basic Auth will only with work with "Get" method in Zapier? Or I'm missing any piece to include here?
Please let me know what is missing? Or even I'm going thru the wrong root. I want to create an app in Zapier to allow other apps to connect.

intermittent error from rally 'Not authorized to perform action: Invalid key' for POST request in chrome extension

I developed a chrome extension using Rally's WSAPI v2.0, and it basically does the following things:
get user and project, and store them
get current iteration everytime
send a post request to create a workitem
For the THIRD step, I sometimes get error ["Not authorized to perform action: Invalid key"] since end of last month.
[updated]Error can be reproduced everytime if I log in Rally website via SSO before using the extension to send requests via apikey.
What's the best practice to send subsequent requests via apikey in my extension since I can't control end users' habits?
I did see some similar posts but none of them is helpful... and in case it helps:
I'm adding ZSESSIONID:apikey in my request header, instead of user /
password to authenticate, so I believe no security token is needed
(https://comm.support.ca.com/kb/api-key-and-oauth-client-faq/kb000011568)
url starts with https://rally1.rallydev.com/slm/webservice/v2.0/
issue is fixed after clearing cookies for
https://rally1.rallydev.com/, but somehow it appears again some time
later
I checked the cookie when the issue was reproduced, and found one with name of ZSESSIONID and its value became something else rather than the apikey. Not sure if that matters though...
code for request:
function initXHR(method, url, apikey, cbFunc) {
let httpRequest = new XMLHttpRequest();
...
httpRequest.open(method, url);
httpRequest.setRequestHeader('Content-Type', ' application\/json');
httpRequest.setRequestHeader('Accept', ' application\/json');
httpRequest.setRequestHeader('ZSESSIONID', apikey);
httpRequest.onreadystatechange = function() {
...
};
return httpRequest;
}
...
usReq = initXHR ('POST', baseURL+'hierarchicalrequirement/create', apikey, function(){...});
Anyone has any idea / suggestion? Thanks a million!
I've seen this error when the API key had both read-only and full-access grants configured. I would start by making sure your key only has the full-access grant.

Unable to get loginForm after addSiteAccount to update credentials

I am using the rest api. After retrieving the login form for a site, I input incorrect login information. I need to now go back and correct the mistake. At first I tried calling GetSiteLoginForm, which isn't allowed since the user is already associated to the site. I then tried to SiteTraversal/getSiteInfo with valid cobSessionToken and &siteFilter.reqSpecfier=16&siteFilter.siteId=643.
The response I get is:
{"popularity":0,"siteId":643,"orgId":520,"defaultDisplayName":"Chase (US)","defaultOrgDisplayName":"Chase Manhattan Bank","contentServiceInfos":[{"contentServiceId":663,"siteId":643,"containerInfo":{"containerName":"bank","assetType":1}},{"contentServiceId":10441,"siteId":643,"containerInfo":{"containerName":"bill_payment","assetType":0}},{"contentServiceId":3163,"siteId":643,"containerInfo":{"containerName":"credits","assetType":2}},{"contentServiceId":3483,"siteId":643,"containerInfo":{"containerName":"stocks","assetType":1}},{"contentServiceId":7100,"siteId":643,"containerInfo":{"containerName":"loans","assetType":2}},{"contentServiceId":3861,"siteId":643,"containerInfo":{"containerName":"mortgage","assetType":2}},{"contentServiceId":12049,"siteId":643,"containerInfo":{"containerName":"miles","assetType":0}}],"enabledContainers":[{"containerName":"bank","assetType":1},{"containerName":"bill_payment","assetType":0},{"containerName":"credits","assetType":2},{"containerName":"stocks","assetType":1},{"containerName":"loans","assetType":2},{"containerName":"mortgage","assetType":2},{"containerName":"miles","assetType":0}],"baseUrl":"http://www.chase.com/","loginForms":[],"isHeld":false,"isCustom":false,"siteSearchVisibility":true}
Note loginForms is empty. How do I get this value? I tried different values of siteFilter.reqSpecfier and always get the same result. Other things I tried were using both the our public and private urls. I duplicated all of this with Dag Site as well.
There is typo in one of the input parameters because of which the parameter is not being recognized by our API’s and hence returning Null LoginForms.
[ siteFilter.reqSpecifier is incorrectly spelled as siteFilter.reqSpecfier ]
Your Excerpt from below email:
cobSessionToken=11182013_0%3A8e8a9caa264e3b26f15c3c9a3ee05680b2edb76272d0a425852a803e6002383b89847d388de38394b4f08efbb881536b496e323ee4e42c9df7dfdcdc8ae10e16&siteFilter.**reqSpecfier**=16&siteFilter.siteId=643
This should be :
cobSessionToken=11182013_0%3A8e8a9caa264e3b26f15c3c9a3ee05680b2edb76272d0a425852a803e6002383b89847d388de38394b4f08efbb881536b496e323ee4e42c9df7dfdcdc8ae10e16&siteFilter.**reqSpecifier**=16&siteFilter.siteId=643
With corrected parameter I was able to query Site 643 and get the loginForm Array. Below is the response with loginForms[]
{"popularity":0
"siteId":643
"orgId":520
"defaultDisplayName":"Chase"
"defaultOrgDisplayName":"Chase Manhattan Bank"
"contentServiceInfos":[{"contentServiceId":663}
{"contentServiceId":10441}
{"contentServiceId":3163}
{"contentServiceId":3483}
{"contentServiceId":7100}
{"contentServiceId":3861}
{"contentServiceId":12049}]
"enabledContainers":[{
"containerName":"bank","assetType":1}
{"containerName":"bill_payment","assetType":0}
{"containerName":"credits","assetType":2}
{"containerName":"stocks","assetType":1}
{"containerName":"loans","assetType":2}
{"containerName":"mortgage","assetType":2}
{"containerName":"miles","assetType":0}]
"baseUrl":"http://www.chase.com/"
"loginForms":[{"conjunctionOp":{"conjuctionOp":1}
"componentList":[
{"valueIdentifier":"LOGIN","valueMask":"LOGIN_FIELD","fieldType":{"typeName":"TEXT"},"size":20,"maxlength":32
"name":"LOGIN","displayName":"User ID","isEditable":true,"isOptional":false,"isEscaped":false,"helpText":"4710","isOptionalMFA":false
"isMFA":false},
{"valueIdentifier":"PASSWORD","valueMask":"LOGIN_FIELD","fieldType":{"typeName":"IF_PASSWORD"},"size":20,"maxlength":40
"name":"PASSWORD","displayName":"Password","isEditable":true,"isOptional":false,"isEscaped":false,"helpText":"11976","isOptionalMFA":false
"isMFA":false}
]
"defaultHelpText":"324"}]
"isHeld":false
"isCustom":false
"siteSearchVisibility":true}
This should resolve your problem
Regards,
Vishal
Yodlee Team
The flow for updating the credentials is listed in this article UpdateCredentials Flow
You can follow the exact steps from the article.
Even when the user is associated to a particular site , you can still pull the login form using getSiteLoginForm and show the form to the user to enter the correct credentials and then pass the login form in updateSiteAccountCredentials and then proceed with the normal refresh flow.

updateSiteAccountCredentials throws IllegalArgumentValueException

I'm using the Yodlee REST API and try to update the credentials at a site.
I'm doing the following sequence:
authenticate/coblogin
authenticate/login
SiteAccountManagement/updateSiteAccountCredentials
In 3 I pass:
cobSessionToken <cobSessionToken>
userSessionToken <userSessionToken>
memSiteAccId <memSiteAccId>
credentialFields.enclosedType com.yodlee.common.FieldInfoSingle
credentialFields[0].name LOGIN
credentialFields[0].displayName User ID
credentialFields[0].valueMask LOGIN_FIELD
credentialFields[0].fieldType.typeName IF_LOGIN
credentialFields[0].valueIdentifier LOGIN
credentialFields[0].value <username>
credentialFields[1].name PASSWORD
credentialFields[1].displayName Password
credentialFields[1].valueMask LOGIN_FIELD
credentialFields[1].fieldType.typeName IF_PASSWORD
credentialFields[1].valueIdentifier PASSWORD
credentialFields[1].value <password>
All according to the API spec.
But all I get back is:
"errorOccured": "true",
"exceptionType": "com.yodlee.core.IllegalArgumentValueException",
"refrenceCode": <referenceCode>,
"message": "Multiple exceptions encapsulated within: invoke getWrappedExceptions for details"
What am I missing?
I'd recommend that you try and do the same credential edit call for another site too.
If the call works for the other site, chances are it is an error related specifically to the site you're trying to edit above (and so, a ticket with Yodlee likely needs to be opened). HTH!