API stops after 65000 records

lock
push_pin
done
Answered
4

Hi

We have a sql datawarehouse setup and every night there is a process where a service connects to the SO API and synchronizes our data. Last night there was an interruption after 65000 records in the Appointment table. Projects, Contacts and Users didnt give an error. I started the sync twice now and each time the sync stops after 65000 records in the Appointment table and log the following error: 

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'online4.superoffice.com'

I tried checking with Postman if there was an error but also there I notice something different. I check the TenantStatus to get the correct API url; in our case thats online4.superoffice.com/... but when I use that API with de SO-AppToken and SOTicket in the header (like we always do) we now get a 401 Unauthorized error.

Is anyone aware of any changes to the API or why the sync systematically breaks after 65000 records?

Any help appreciated! Thanks in advance

20 Aug 2024 | 08:09 AM

All Replies (4)

Are you retrieving all these records at once? or over multiple api calls? Maybe the result size is too big, causing you to get a timeout error? Try decreasing the batch size.

(Note: if you are retrieving this many records, maybe database mirroring is a better option?)

20 Aug 2024 | 08:13 AM
Hi David. Much appreciated for the quick feedback. The service is setup to run batches of 1000 records. I'll see what it says if I lower the batch size. We have looked into Database Mirroring but there were some incompatibilities with custom integrations and development; but that was a while ago so I'll check with our account manager again.
20 Aug 2024 | 08:19 AM

I updated the batch size to 500 and now it stopped twice after exactly 7000 records.

20 Aug 2024 | 08:54 AM

Hi Eddy,

I see the API calls you're making and I would sugguest optimizing even more these requests: https://docs.superoffice.com/en/developer-portal/best-practices/index.html#optimization

When you get into the higher number it may be an idea to include like a give me a batch from the last primaryKey order by primaryKey. 

Do contact us at appdev@superoffice.com if you want more insight than what you get in the developer portal under metrics: https://docs.superoffice.com/en/developer-portal/analytics/metered-services.html

20 Aug 2024 | 03:05 PM

Add reply