我正在尝试使用 addItemForContentService1 为登录用户添加项目到内容服务。在调用此API方法之前,我正在调用 getLoginFormForContentService 来获取特定内容服务的登录表单。据我所知,我已根据需要填充数据,从前面检索的表单中获取所有字段,将它们放入“credentialFields”,只添加带有所需值(用户名/密码)的属性“value”,由每个字段的用户(我的用户/客户)提供。另外,我已经在API参考中记录的输入JSON中设置了其他字段。
我工作的内容服务是ETrade,内容服务ID = 24(因为我有一个真实帐户,我可以使用)。
以下是使用php的curl CURLOPT_VERBOSE选项捕获的POST参数:
cobSessionToken = 08062013_0%3A25553263f0443831be2f0c75dad28bc57896d59ac4aec35cf20 43ef186a65d2e726cd78d299d1b69cf06f64c606d7f89b2a9b6118ce24d9b438bdd70d24e82b1&安培;使用rSessionToken = 08062013_0%3Aec610a637dc6e59bd76214c3089e2459bf6b55f42b14d11dd836e3 59e2e8acd8e9f524e5ae50f21a0274c4e82a25f2f8ad799a8519d6947751dbab64fe3a4dea&安培; conten tServiceId = 24&安培; shareCredentialsWithinSite =真安培; startRefreshItemOnAddition =真安培; CRE dentialFields%5BenclosedType%5D = com.yodlee.common.FieldInfoSingle&安培; credentialField S%5B0%5D%5BvalueIdentifier%5D = LOGIN&安培; credentialFields%5B0%5D%5BvalueMask%5D = LOGIN_领域&安培; 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 =用户+ ID&安培; credentialFi视场%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&安培;克雷德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 =密码&安培; 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&安培;凭证字段%5B1%5D%5BisMFA%5D = 0&安培; credentialFields%5B1%5D%5Bvalue%图5D = XXXX
我一直收到错误:
发生未知异常
参考代码= _4c956ae5-bf4f-4d5a-801a-6abe752705d8
message =参数类型不匹配
详细值=技术难度处理请求
我似乎无法找到问题的原因。有人可以帮忙吗?
谢谢!
答案 0 :(得分:1)
以下是对Etrade的请求。传递正确的凭据
"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
请注意,credentialFields [2]是一个可选字段,因此您可以选择不传递它。
另外,请务必在此API调用后关注refresh flow。