Hello
I have only just dived into the FreeAgent API, so please forgive me if this is a basic error, but I am getting a 404 whenever I try and retrieve transactions.
curl https://api.sandbox.freeagent.com/v2/bank_accounts lists all the accounts in my sandbox FreeAgent account and returns no errors
But /v2/bank_transactions?bank_account=test gives a 404.
test is the name of the bank account in FreeAgent. I have also tried replacing test with 35706 (as the URL for the account returned in the first step is https://api.sandbox.freeagent.com/v2/bank_accounts/35706
What am I doing wrong?! Could it be access permissions? I wouldn’t have thought so as that wouldn’t give a 404 - would it?
Thanks in advance,
Andrew
Hello Andrew
I’m Brad from the Banking team at FreeAgent.
When using our API, you’ll need to use the full API URL for these URL parameters.
For example, if you wanted to get the transactions for a bank account with an ID of 35706, you’d call the API endpoint like:
https://api.sandbox.freeagent.com/v2/bank_transactions?bank_account=https://api.sandbox.freeagent.com/v2/bank_accounts/35706
I hope this helps?
Thanks so much Brad
To be sure - I couldn’t post with 2 links, so had to shorten one. I’ve pasted to this post a screenshot of my curl URL just in case - hope you can read it!
Thanks so much for your help!
Did you mean to write
https://api.sandbox.freeagent.com/v2/bank_transactions?bank_account=https://api.sandbox.freeagent.com/v2/bank_accounts/35706
Should it not be…?
https://api.sandbox.freeagent.com/v2/bank_accounts/35706
Andrew