我试图使用Yodlee / executeUserSearchRequest作为RESTful请求,并需要一个如何调用的答案

时间:2013-11-20 12:01:23

标签: api rest yodlee

我正在使用c#中的Yodlee服务并使用RESTful api。到目前为止,我已成功连接并在开发环境中使用我的CobrandSession和UserSessionToken登录。我使用了c#中提供的示例应用程序,并提供了一些来自shreyans的建议,我得到了一个应用程序。我工作的是 1)获取YodleeAuthentication 2)获取UserAuthentication 3)获取ItemSummaries

我现在正在尝试获取每个项目的完整交易详情(即作为项目的帐户集合)

在这里阅读文档https://developer.yodlee.com/Indy_FinApp/Aggregation_Services_Guide/REST_API_Reference/executeUserSearchRequest它表明我需要调用executeUserSearchRequest,然后使用getUserTransactions对结果进行分页。所以我被困在这一点上。我真的不想要一个有参数的搜索我只想要这个帐户的所有交易,我可以看到。

但是,我正在使用该页面中定义的变量: -

var request = new RestRequest("/jsonsdk/TransactionSearchService/executeUserSearchRequest", Method.POST);
request.AddParameter("cobSessionToken", param.CobSessionToken);
request.AddParameter("userSessionToken", param.UserSessionToken);
request.AddParameter("transactionSearchRequest.containerType", param.ContainerType);
request.AddParameter("transactionSearchRequest.higherFetchLimit", param.HigherFetchLimit);
request.AddParameter("transactionSearchRequest.lowerFetchLimit", param.LowerFetchLimit);
request.AddParameter("transactionSearchRequest.resultRange.endNumber", param.EndNumber);
request.AddParameter("transactionSearchRequest.resultRange.startNumber", param.StartNumber);
request.AddParameter("transactionSearchRequest.searchFilter.currencyCode", param.CurrencyCode);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.fromDate", param.FromDate);
request.AddParameter("transactionSearchRequest.searchFilter.postDateRange.toDate", param.ToDate);
request.AddParameter("transactionSearchRequest.searchFilter.transactionSplitType.splitType", param.SplitType);
request.AddParameter("transactionSearchRequest.ignoreUserInput", param.IgnoreUserInput);
request.AddParameter("transactionSearchRequest.searchFilter.itemAcctId", param.ItemAcctId);
var response = RestClientUtil.GetBase().Execute(request);
var content = response.Content;
return new YodleeServiceResultDto(content);

根据shreyans在此帖子Getting Error "Any one of [**] of transactionSearchFilter cannot be NULL OR Invalid Values中的回复,我没有放入ClientId和ClientName

文档没有指定日期的格式,但示例似乎告诉我它的美国日期格式。并指定一个名为IgnoreUserinput的参数,但没有用户输入的参数,因此这很容易混淆

当我使用此格式拨打电话时,我收到错误回复

var getSearchResult = yodleeExecuteUserSearchRequest.Go(yodleeExecuteUserSearchRequestDto);
getSearchResult.Result="
{"errorOccured":"true","exceptionType":"Exception Occured","refrenceCode":"_60ecb1d7-a4c4-4914-b3cd-49182518ca5d"}"

但是我没有收到任何错误消息,而且我不知道我做错了什么或者在哪里查找此错误,使用Yodlee REST Api的人是否可以指向正确的方向,因为我需要对此进行研究迅速....

感谢您的帮助,建议,更正和指示......

1 个答案:

答案 0 :(得分:1)

以下是您可以尝试的参数列表

1)对于特定的ItemAccountId所有交易

transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353

2)对于具有开始和结束日期的特定帐户(itemAccountId)

transactionSearchRequest.containerType=all
transactionSearchRequest.higherFetchLimit=500
transactionSearchRequest.lowerFetchLimit=1
transactionSearchRequest.resultRange.startNumber=1
transactionSearchRequest.resultRange.endNumber=500
transactionSearchRequest.searchClients.clientId=1
transactionSearchRequest.searchClients.clientName=DataSearchService
transactionSearchRequest.searchFilter.currencyCode=USD
transactionSearchRequest.searchClients=DEFAULT_SERVICE_CLIENT
transactionSearchRequest.ignoreUserInput=true
transactionSearchRequest.ignoreManualTransactions=false
transactionSearchRequest.searchFilter.transactionSplitType=ALL_TRANSACTION
transactionSearchRequest.searchFilter.itemAccountId.identifier=10000353
transactionSearchRequest.searchFilter.postDateRange.fromDate=08-01-2013
transactionSearchRequest.searchFilter.postDateRange.toDate=10-31-2013