Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Setting if modified since in the XeroAPI.net library

Started by Matthew Steeples -   in API Endpoints

Hi,

I'm trying to retrieve all of the journals from an account but it's only giving me the first 100. I'm trying to re-issue the request to the service using the following code but it only retrieves the last item from the first batch returned. It appears to be acting as = rather than >.

var moreJournals = repository.Journals.Where(a => a.CreatedDateUTC > maxDate).ToArray();

This results in the following URL request:

GET /api.xro/2.0/Journals?WHERE=(CreatedDateUTC > DateTime(2011,10,13,0,22,55))

Is there a built in way to use the If-Modified-Since header?

Regards,
Matthew
Ok, I've dug around the source code and I feel like I've found the cause:

I think that the CreatedDateUTC property needs the ItemUpdatedDateAttribute on it.

I've created a GitHub issue for it here.
 

Matthew Steeples  

Hi Matthew,

Thanks for sending the github pull requests. The missing attributes inside the Journal class were pretty obvious, but the bugs inside ApiQueryTranslator and IntegrationProxy were obscure. You did well finding those bugs.

I've taken in your changes into github and published a new build of XeroAPI.Net to NuGet (v1.1.0.1).

Dan..
 

Daniel Barratt (Xero Staff)  

Hi Dan,

Thanks for that. The NuGet package has been updated to v1.1.0.1 but still contains the v1.1.0.0 dll in it. Could you publish it again please?

Regards,
Matthew
 

Matthew Steeples  

Yep, my bad. I've published the package to NuGet again (and again). It should now be at version v1.1.0.3.

Dan..
 

Daniel Barratt (Xero Staff)  

That's great thanks.
 

Matthew Steeples