Bank transaction missing data for November

Hi,

From the UI with the URI of

https://badrobot.freeagent.com/bank_accounts/14127?utf8=✓&view=
2013-11-01_2013-11-30&per_page=50

I get about 39 records but when I use the API with (what I think is) an
equivalent URI;

GET /v2/bank_transaction_explanations?bank_account=https:
//api.freeagent.com/v2/bank_accounts/14127&from_date=2
013-11-01&to_date=2013-11-30 HTTP/1.1

I get only 25 records.

I’ve done this for previous months and not noticed missing explanations, am
I missing something?

I spotted a header in the response;

Link: https://api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30;
rel=‘next’,
https://api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30;
rel=‘last’

Did relative links (RFC 5988 http://tools.ietf.org/html/rfc5988) sneak in
without me noticing? Is there a way I can get them all back in one go (like
the docs implyhttps://dev.freeagent.com/docs/bank_transaction_explanations#list-all-bank-transaction-explanations)?
I’m not sure I want pagination…

Thanks in advance,
Toby

Hi Toby,

Glad Ben was able to help. In answer to your questions:

ps, when was this put in, I didn’t notice it last month… but that could

just mean my reports have been off for some time!

The pagination has been in place (and documented) since we launched v2 of
the API in April last year.

would you consider allow a GET without pagination… is pagination generally

more useful for UI clients to an API? Programmatic clients have to do more
work to follow the hypermedia breadcrumbs but they’re more flexible as
such?.

Pagination was a deliberate decision early in the design of v2, and it’s
unlikely that we’ll do much in the future beyond possibly changing the page
size limits available.

Considering the huge variance in dataset sizes across different accounts,
if anything it’s more important to provide pagination via the API than
via the UI. If we allowed a page size of “all” for arbitrary account
resources, our developers would have to deal with the fact that they could
be sent hundreds of thousands of entries (with no way of knowing before
request the likely size of the response). They’d be much more likely to
have to accommodate timeouts, dropped connections and so on.
Programmatically traversing links and assembling a full set of data is, if
anything, simpler with an API than via a UI: a developer can store previous
pages, keep track of what page they have already pulled up to and so on.
Once these code paths are set up, they will work without additional effort
by the developer.

There are certainly things we can (and will) do to improve the options to
retrieve data from the API, but pagination is likely to be a feature of
these options for the foreseeable future.

Cheers,

-J

ps, when was this put in, I didn’t notice it last month… but that could
just mean my reports have been off for some time!On Thursday, 5 December 2013 08:22:45 UTC, Toby wrote:

ok thanks, that clears it up.

would you consider allow a GET without pagination (ie, drop the 100
limit?). It’s more work for me to follow the trail in the Link header
programmatically but I realise it could have an affect on your servers
(would you see load issues allowing a single large query version several
small ones?).

It’s an interesting point from an API design perspective though;
is pagination generally more useful for UI clients to an API? Programmatic
clients have to do more work to follow the hypermedia breadcrumbs but
they’re more flexible as such?.

thanks again,
Toby

On Wednesday, 4 December 2013 23:28:45 UTC, Ben wrote:

Hi Toby,

Yes, all API requests that return multiple items are paginated. You can
increase the number of items with the “per_page” param (up to max of 100).
If you still need more items, you’ll need to use the information in the
Link header to make multiple requests.

You can learn more here: https://dev.freeagent.com/docs/introduction(under “Pagination”).

I hope that helps.

Best wishes,
Ben

On Wednesday, 4 December 2013 13:39:36 UTC-8, Toby wrote:

Hi,

From the UI with the URI of

https://badrobot.freeagent.com/bank_accounts/14127?utf8=✓&view=
2013-11-01_2013-11-30&per_page=50

I get about 39 records but when I use the API with (what I think is) an
equivalent URI;

GET /v2/bank_transaction_explanations?bank_account=https://
api.freeagent.com/v2/bank_accounts/14127&from_date=2
013-11-01&to_date=2013-11-30 HTTP/1.1

I get only 25 records.

I’ve done this for previous months and not noticed missing explanations,
am I missing something?

I spotted a header in the response;

Link: <https://
api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘next’, <
https://api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘last’

Did relative links (RFC 5988 http://tools.ietf.org/html/rfc5988) sneak
in without me noticing? Is there a way I can get them all back in one go (like
the docs implyhttps://dev.freeagent.com/docs/bank_transaction_explanations#list-all-bank-transaction-explanations)?
I’m not sure I want pagination…

Thanks in advance,
Toby

Hi Toby,

Yes, all API requests that return multiple items are paginated. You can
increase the number of items with the “per_page” param (up to max of 100).
If you still need more items, you’ll need to use the information in the
Link header to make multiple requests.

You can learn more here: https://dev.freeagent.com/docs/introduction (under
“Pagination”).

I hope that helps.

Best wishes,
BenOn Wednesday, 4 December 2013 13:39:36 UTC-8, Toby wrote:

Hi,

From the UI with the URI of

https://badrobot.freeagent.com/bank_accounts/14127?utf8=✓&view=
2013-11-01_2013-11-30&per_page=50

I get about 39 records but when I use the API with (what I think is) an
equivalent URI;

GET /v2/bank_transaction_explanations?bank_account=https://
api.freeagent.com/v2/bank_accounts/14127&from_date=2
013-11-01&to_date=2013-11-30 HTTP/1.1

I get only 25 records.

I’ve done this for previous months and not noticed missing explanations,
am I missing something?

I spotted a header in the response;

Link: <https://
api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘next’, <
https://api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘last’

Did relative links (RFC 5988 http://tools.ietf.org/html/rfc5988) sneak
in without me noticing? Is there a way I can get them all back in one go (like
the docs implyhttps://dev.freeagent.com/docs/bank_transaction_explanations#list-all-bank-transaction-explanations)?
I’m not sure I want pagination…

Thanks in advance,
Toby

ok thanks, that clears it up.

would you consider allow a GET without pagination (ie, drop the 100
limit?). It’s more work for me to follow the trail in the Link header
programmatically but I realise it could have an affect on your servers
(would you see load issues allowing a single large query version several
small ones?).

It’s an interesting point from an API design perspective though;
is pagination generally more useful for UI clients to an API? Programmatic
clients have to do more work to follow the hypermedia breadcrumbs but
they’re more flexible as such?.

thanks again,
TobyOn Wednesday, 4 December 2013 23:28:45 UTC, Ben wrote:

Hi Toby,

Yes, all API requests that return multiple items are paginated. You can
increase the number of items with the “per_page” param (up to max of 100).
If you still need more items, you’ll need to use the information in the
Link header to make multiple requests.

You can learn more here: https://dev.freeagent.com/docs/introduction(under “Pagination”).

I hope that helps.

Best wishes,
Ben

On Wednesday, 4 December 2013 13:39:36 UTC-8, Toby wrote:

Hi,

From the UI with the URI of

https://badrobot.freeagent.com/bank_accounts/14127?utf8=✓&view=
2013-11-01_2013-11-30&per_page=50

I get about 39 records but when I use the API with (what I think is) an
equivalent URI;

GET /v2/bank_transaction_explanations?bank_account=https://
api.freeagent.com/v2/bank_accounts/14127&from_date=2
013-11-01&to_date=2013-11-30 HTTP/1.1

I get only 25 records.

I’ve done this for previous months and not noticed missing explanations,
am I missing something?

I spotted a header in the response;

Link: <https://
api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘next’, <
https://api.freeagent.com/v2/bank_transaction_explanations?page=2&per_page=25&bank_account=14127&from_date=2013-11-01&to_date=2013-11-30>;
rel=‘last’

Did relative links (RFC 5988 http://tools.ietf.org/html/rfc5988) sneak
in without me noticing? Is there a way I can get them all back in one go (like
the docs implyhttps://dev.freeagent.com/docs/bank_transaction_explanations#list-all-bank-transaction-explanations)?
I’m not sure I want pagination…

Thanks in advance,
Toby