XeroAPI/Xero-Java

getBankTransactions() returns 404 when blank tenant id is passed via Custom Connection

stuartclayton opened this issue · 2 comments

I've been able to replicate this with the Java and Node sample code (using latest client versions of both) so it appears to be an issue with the API itself. My own java code results in:

com.xero.api.XeroNotFoundException: The resource you're looking for cannot be found

Caused by: com.google.api.client.http.HttpResponseException: 404 Not Found
GET https://api.xero.com/api.xro/2.0/BankTransactions?where=Reference%3D%3D%22ch_1JAvr62yem292nKAWBEOMCUX%22&order&page=1&unitdp=2
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1113)
	at com.xero.api.client.AccountingApi.getBankTransactionsForHttpResponse(AccountingApi.java:10357)
	at com.xero.api.client.AccountingApi.getBankTransactions(AccountingApi.java:10234)

I'm using the new Custom Connection and all other API calls have worked as expected with empty string for Tenant ID.

Out of curiosity I was using the API Explorer for my Demo Company for getBankTransactions(). I took the Tenant ID from the interface there and hard coded it into my java call and then it worked as expected returns a populated BankTransactions collection.

Just to confirm adapting this example for Direct Connection should replicate the issue:
https://xeroapi.github.io/Xero-Java/v4/accounting/index.html#api-Accounting-getBankTransactions

This should now be resolved, please contact api@xero.com if it is still not working for you