1

不仅想从 Yodlee REST API 获取已发布的交易,还想获得待处理的交易。

根据Yodlee 的文档,这似乎是可能的

这是代码:

transactions_url = "https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/TransactionSearchService/executeUserSearchRequest"
transactions_data = {
    "cobSessionToken": self.cob_session_token,
    "userSessionToken": self.user_session_token,
    "transactionSearchRequest.containerType": "All",
    "transactionSearchRequest.higherFetchLimit": 1000,
    "transactionSearchRequest.lowerFetchLimit": 1,
    "transactionSearchRequest.resultRange.endNumber": 20,
    "transactionSearchRequest.resultRange.startNumber": 1,
    "transactionSearchRequest.searchClients.clientId": 1,
    "transactionSearchRequest.searchClients.clientName": "DataSearchService",
    "transactionSearchRequest.ignoreUserInput": True,
    "transactionSearchRequest.searchFilter.currencyCode": "USD",
    "transactionSearchRequest.searchFilter.postDateRange.fromDate": "12-01-2013",
    "transactionSearchRequest.searchFilter.postDateRange.toDate": "12-16-2013",
    "transactionSearchRequest.searchFilter.transactionStatus": 2,
    "transactionSearchRequest.searchFilter.transactionSplitType": "ALL_TRANSACTION",
}

res = requests.post(transactions_url, transactions_data)

发送 key-val 对"transactionSearchRequest.searchFilter.transactionStatus", 2给我以下错误:

{
    "errorOccured": "true",
    "exceptionType": "Exception Occured",
    "refrenceCode": "XXXXXXXXXXXX"
} 

有任何想法吗?

4

2 回答 2

1

FYI : I'm currently running tests to get today's transactions (we have major issues with this) and although i still have not successfully done this I can successfully get back transaction without supplying From and To dates as paramteters. Not sure if this helps any one else.

My test also show which formats can get a positive result

"MM-dd-yyyy" PASS - get a correctly formatted search result with transactions

"yyyy-dd-MMTHH:mm:ss.000Z" FAIL - format supplied by yodlee support. *
"yyyy-MM-ddTHH:mm:ss.000Z" FAIL - ISO equivalent of format supplied by yodlee support **
"yyyy-MM-ddTHH:mm:ssZ" FAIL - ISO standard format using Z to imply UTC - no milliseconds **
"yyyy-MM-ddTHH:mm:ss+00:00" FAIL - ISO standard format - No Z - no Milliseconds **

* returns
{ "searchIdentifier":{},"numberOfHits":0 }

** returns

{"errorOccurred":"true","exceptionType":"com.yodlee.core.IllegalArgumentValueException","referenceCode":"_d87c92ac-0eed-449e-
a14d-7ac78443c2fe","message":"Invalid argument value: Start date cannot be great than end date"}
于 2014-06-19T03:36:53.777 回答
1

API 返回账户中存在的所有交易,包括待处理交易和已发布交易。您需要在返回给您的响应中检查交易的状态,该响应将被标记为待处理或已发布。因此,您无需显式传递此参数,但如果您只想获取待处理事务,请尝试传递如下参数

id 为 2 的“transactionSearchRequest.searchFilter.transactionStatus.statusId”。

请确保该帐户有待处理的交易以获得适当的响应。

于 2013-12-18T21:29:48.563 回答