Page 1 of 1

Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Wed Mar 27, 2024 10:47 pm
by avinash.walkerscott
Is there a way to fetch the customers that are only modified/created on a particular day/time interval?

We tried using the following api's and couldn't find the appropriate way of doing it.
/customers/?DateModified=2024-03-26
/customers/?DateCreated=2024-03-26
/customers/?DateIssued=2024-03-26

I am new to this and searched already the forum and documents, but couldn't find much. And if there is a way to fetch between the time interval, that would even be better.
Any suggestions would be highly appreciated.

Thanks,

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Wed Mar 27, 2024 11:42 pm
by Sindre
Hi avinash,
To query based on the date modified you can add a parameter in the header for if-modified-since timestamp which will give you all changes after this timestamp.

See more info here:
https://developer.simprogroup.com/apido ... -resources

To search within a specified timeframe you can try the search operators described here to see if you get the results you want.
https://developer.simprogroup.com/apido ... -resources

For example you can search customers like this

Code: Select all

/api/v1.0/companies/{companyID}/customers/?DateModified=between(2024-03-01,2024-03-28)
Regards

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Mon Apr 01, 2024 6:57 pm
by avinash.walkerscott
Thank you. That is working.
But another observation is that, the records from "Transactions Ready For Export Report" is not getting cleared after import. This is misleading to integration, can you please help here.

Thanks,

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Tue Apr 02, 2024 12:06 am
by Sindre
Hi,
I'm glad to hear you got it working.

This report is not a part of our API but can be found in Simpro Premium. For questions regarding our Simpro reports and other features I recommend you to contact our Simpro Helpdesk for more details.

You can find the contact detail here:
https://helpdesk.simprogroup.com/

Regards

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Wed Apr 03, 2024 1:55 am
by avinash.walkerscott
Hi, found that it is not working for transaction data like invoices, credits etc.
In the below example of code, there are invoices created after 1 pm today. But when sending last modified time as 01:00:00 GMT, there are no invoices returned. The same with "If-Modified-Since: Wed, 03 Apr 2024 00:00:00 GMT" works.

Code: Select all

@taxInvoices = companies/{{companyID}}/invoices/
GET {{requestURL}}{{taxInvoices}} HTTP/1.1
Authorization: {{accessToken}}
Accept: application/json
If-Modified-Since: Wed, 03 Apr 2024 01:00:00 GMT
Could you please guide here.
Thanks,

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Wed Apr 03, 2024 5:46 am
by dan.zhang
hey Avinash,
The DateModified param should be working. /api/v1.0/companies/{companyID}/invoices/?DateModified=ge(2024-04-02)
The date format need to be YYYY-MM-DD.

Regards

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Wed Apr 03, 2024 9:17 pm
by avinash.walkerscott
Hey.
Thanks for the reply.
But the dateModified can not be used as DateTime right? What if I want to pull the data from specific date and time?

Thanks,

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Sun Apr 14, 2024 11:29 pm
by AidenTew
Hi Avinash,

Thank you for your message, unfortunately DateModified columns across all routes are YYYY-mm-dd only, however, it is possible to use YYYY-mm-ddThh:mm:ss if you use If-Modified-Since header.

Hope that helps.

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Thu Apr 25, 2024 7:34 am
by avinash.walkerscott
Hi.
Its kinda weird behaviour I am facing. The customer is modified on 23rd Apr. The log is also created and it shows the date time as 23/04/2024 08:41.
But when I pull the data using If-Modified-Since, it doesn't show for the date 23rd.
Eg:

Code: Select all

If-Modified-Since: Tue, 23 Apr 2024 07:00:01 GMT
But, if I change the modified datetime to 22nd then the data appears in api.
What is wrong with If-Modified-Since I am sending as? how to solve this?

Thanks,

Re: Featch customers/clients records that are only modified/created on a particular day/time interval

Posted: Thu Apr 25, 2024 9:36 pm
by AidenTew
Hi Avinash,

Maybe try with the timezone and see if that works.

eg.

Code: Select all

If-Modified-Since: Fri, 26 Apr 2024 07:00:01+12