API to get most recent N cleared transactions

I'm writing a custom script to import transactions from the SMS messages on my phone. I have years of SMSes so the first thing I need to know is where to start in the transaction history. Currently I have to download the whole list of transactions from YNAB to be able to find the most recent cleared one, and then I can start parsing all SMSes which arrived on/after that date to avoid duplicates.

To implement this I need two small changes on endpoint /budgets/{budget_id}/accounts/{account_id}/transactions:

- Having a `limit` or parameter (assuming transactions are ordered by date descending). This would probably reduce the load on your servers as well.

- Having a `cleared` or `reconciled` option for the `type` parameter 

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • While having those features would certainly make this easier, you can also do this pretty efficiently by caching data locally and using `last_knowledge_of_server` to only get the changes between runs.  That way you only need to download the full list of transactions once, and thereafter you only have to download any new/changed transactions.  Your script can then keep track of the most recent cleared one itself.

    Reply Like 1
Like Follow
  • 5 mths agoLast active
  • 1Replies
  • 104Views
  • 2 Following