Search code examples
yodlee

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


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!


Solution

  • 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.