Many integrations need to sync data. While this is perfectly acceptable, there are a few best practices you should be aware of.
Don’t sync on the hour
Everybody wants to sync on the hour. So you should schedule your sync jobs to run at a time other than on the hour to avoid competing for resources.
Always use GetDataArray SOAP commands
This will cut down on the number of API calls dramatically. If you for example want to get vat rates for all product groups, then start out by getting the data arrays for ProductGroupData, AccountData and VatAccountData. Then you can loop over the product groups, and look up the data for accounts and subsequently vat accounts in the two other data arrays. In stead of having to look up every single account and vat account every time you look at a product group, you only do three calls to our API. The end result is a major performance boost for your application, and much less strain on our servers.
Use GetAllUpdated SOAP commands
Use GetAllUpdated SOAP commands to only get the data that has been updated since your last sync. A number of resources in our API set a last updated flag when ever the data changes. That means you can limit the data you need to sync by keeping track of when you last did a syn job. Combine this with GetDataArray to really boost your performance.
Use web hooks whenever possible
In some cases you can sync just the data that needs syncing. If you set up web hooks for changes to alert you when a product changes for example, then you won’t need to do sync as often. Read more about web hooks here https://www.e-conomic.com/developer/working-with-web-hooks.
Man kan ikke lave en god sync kun med GetAllUpdated da man ikke får besked om slettet data. Man ville kunne lave en mellemting ting hvis I eksponerede Updated på fx. project, time og mileage. Som det er nu bliver man alligevel nødt til at hente alt for fx at fjerne slettet data.
Hi Tim,
It is correct that the GetAllUpdated does not include deleted entities. Webhooks do notify you of deletions though. So you could use a combination of the two.
I will add exposing update timestamps on project related entities to our feature request backlog, but it is not something that will happen anytime soon unfortunately.
When will we see GetAllUpdated implemented in the REST api? It would be nice to leave the SOAP implementation behind.
Hi Henrik,
The entities that have a lastUpdated property will allow you to do that with filtering. There is no method or convenience link for that in the REST API.
An example of doing this is something like this:
https://restapi.e-conomic.com/customers?demo=true&filter=lastUpdated$gt:2015-07-01
This will return all customers updated after July 1st 2015.