xero api - Get all journals for Demo UK -
i'm attempting read journals associated demo uk company repeatedly end same data. i'm calling journals endpoint multiple times seem end same data. api documentation:
a maximum of 100 journals returned in response. use offset or if-modified-since filters (see below) multiple api calls retrieve larger sets of journals
code snippet use journals seen below - reckon beginner mistake help/guidance appreciated.
list<journal> batchjournals; list<journal> alljournals = new list<journal>(); int skip = 0; var journalsendpoint = m_api.journals.offset(skip); while((batchjournals = journalsendpoint.find().tolist()).count > 0) { alljournals.addrange(batchjournals); skip += batchjournals.count; journalsendpoint = journalsendpoint.offset(skip); //get next 100 journals }
just came across , noticed nobody had answered. you've figured out now. journal numbers on demo company may not start @ 0 depending on first journal number same data each time. real xero organisations journals start @ 1.
Comments
Post a Comment