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

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
avinash.walkerscott
Posts: 9
Joined: Tue Mar 26, 2024 8:49 pm
Location: New Zealand

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

Post by avinash.walkerscott » Wed Mar 27, 2024 10:47 pm

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,
Cheers
Avinash
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

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

Post by Sindre » Wed Mar 27, 2024 11:42 pm

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
Sindre
API Developer | Simpro Software Group
avinash.walkerscott
Posts: 9
Joined: Tue Mar 26, 2024 8:49 pm
Location: New Zealand

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

Post by avinash.walkerscott » Mon Apr 01, 2024 6:57 pm

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,
Cheers
Avinash
Sindre
Posts: 493
Joined: Wed Apr 20, 2022 4:51 am
Location: Brisbane

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

Post by Sindre » Tue Apr 02, 2024 12:06 am

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
Sindre
API Developer | Simpro Software Group
avinash.walkerscott
Posts: 9
Joined: Tue Mar 26, 2024 8:49 pm
Location: New Zealand

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

Post by avinash.walkerscott » Wed Apr 03, 2024 1:55 am

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,
Cheers
Avinash
dan.zhang
Posts: 10
Joined: Fri Mar 01, 2024 4:20 am

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

Post by dan.zhang » Wed Apr 03, 2024 5:46 am

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
Dan
API Developer | Simpro Software Group
avinash.walkerscott
Posts: 9
Joined: Tue Mar 26, 2024 8:49 pm
Location: New Zealand

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

Post by avinash.walkerscott » Wed Apr 03, 2024 9:17 pm

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,
Cheers
Avinash
AidenTew
Posts: 25
Joined: Fri Mar 01, 2024 4:15 am

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

Post by AidenTew » Sun Apr 14, 2024 11:29 pm

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.
Aiden
API Developer | Simpro Software Group
avinash.walkerscott
Posts: 9
Joined: Tue Mar 26, 2024 8:49 pm
Location: New Zealand

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

Post by avinash.walkerscott » Thu Apr 25, 2024 7:34 am

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,
Cheers
Avinash
AidenTew
Posts: 25
Joined: Fri Mar 01, 2024 4:15 am

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

Post by AidenTew » Thu Apr 25, 2024 9:36 pm

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
Aiden
API Developer | Simpro Software Group
Post Reply