Solved

How to Fetch Latest data from API

  • 15 September 2023
  • 5 replies
  • 123 views

Userlevel 2
Badge

I have a sync going where I am trying to do “delta” loads of different types of data from Acumatica. I am extracting certain entities for use in an external customer facing eCommerce website.

 

What is the best method I should use to make sure I am getting the latest data. For instance, If I run a sync every hour, how to I go about ensuring I get the latest records (ie: SalesOrder, Invoices, StockItems, etc.)

I have GI’s created for them all which work well. My approach right now is to use the “LastModifiedOn” date and load records based on that. I then page through those result sets (if needed).  Sometimes we need to do a full resync or “hydration” of a new entity….so I sync in nested batches.

Psudeo code is

LastModifiedOn ge 09/14/2023 and LastModifiedOn le 09/15/2023 $top=100, $skip=100 (page 2) 

Inside of that, I will page if needed.

I am not confident I am doing this the best and most efficient way. I wanted to ping the broader community to see if there may be a better approach

Thank you all for your recommendations!

 

Eric

icon

Best answer by Vignesh Ponnusamy 18 September 2023, 20:35

View original

5 replies

Userlevel 7
Badge +4

Hi @eelliston,

You can consider using Push Notification where Acumatica sends the JSON update to the destination URL. 

For more details on it refer, https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=43fc945a-f762-4924-b538-21632beb8441

Good Luck.! 

Userlevel 2
Badge

Thank you for this. We do have a lot of push notifications as well. Sometimes that doesn’t work for for certain business cases. We also need to a way to “hydrate” our ecommerce portal with a fresh sync of data. Push notifications are great for near-realtime delta updates...but I need a method to build up that initial sync of data.

 

Thanks!

 

Eric

Userlevel 7
Badge +4

Hi @eelliston,

In that case, filtering the GI should be good to fill in the data. To make it more precise/efficient have you considered adding more parameters(especially key identifier fields like OrderNbr, InvoiceNbr) to the GI using which you can filter/retrieve the data?

For example, in the last sync you have synced SO up to SO00010. After an hour for the next sync, you can look for SO greater than SO00010. 

Userlevel 2
Badge

OK….that is what I was unclear on. Do the Key identifiers usually increment?

 

SO00010, SO00011, SO00012, etc.

 

Userlevel 7
Badge +4

Usually, yes. In some cases there could be a combination key like Order Type and Order Nbr, so based on the screen and your settings you can try to setup a GI parameter that suits your requirements. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved