ECONNRESET when attempting PUT ShortQuery with Offset

For requests or help with our API
Post Reply
graham_mueller
Posts: 10
Joined: Fri Jan 19, 2024 10:57 am

ECONNRESET when attempting PUT ShortQuery with Offset

Post by graham_mueller » Mon Mar 04, 2024 2:16 pm

I started to try to loop through result sets today, because one query is getting a set of appointments with length > 100. When I make a second request with Offset=100, the OD API server seems to be killing my connection each time. I'm hitting [PUT] https://api.opendental.com/api/v1/queri ... Offset=100. Is there something I'm missing here?

justine
Posts: 175
Joined: Tue Dec 28, 2021 7:59 am

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Post by justine » Mon Mar 04, 2024 2:51 pm

graham_mueller wrote:
Mon Mar 04, 2024 2:16 pm
I started to try to loop through result sets today, because one query is getting a set of appointments with length > 100. When I make a second request with Offset=100, the OD API server seems to be killing my connection each time. I'm hitting [PUT] https://api.opendental.com/api/v1/queri ... Offset=100. Is there something I'm missing here?
Good afternoon graham_mueller,

I don't know what your query looks like but the ShortQuery endpoint is intended for simple queries. A ShortQuery will execute your query in its entirety, and then apply a limit and/or offset to that result set. If you are running into a timeout situation by attempting to grab every appointment in the database, then offsetting it, it is highly recommended that you instead use the appointments GET multiple endpoint, with optional params.

Thanks!

graham_mueller
Posts: 10
Joined: Fri Jan 19, 2024 10:57 am

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Post by graham_mueller » Mon Mar 04, 2024 3:01 pm

Hi Justine,

These are "short" queries, I'm not getting a timeout - the API is resetting my connection. The appointment endpoint doesn't provide the data I need, or rather doesn't provide the filter controls I needed. We discussed this is another thread about Appointment Slots. The issue isn't the query, it works fine without an offset, it's once I start to offset. I'm curious if it's something to do with the rate limiting.

graham_mueller
Posts: 10
Joined: Fri Jan 19, 2024 10:57 am

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Post by graham_mueller » Mon Mar 04, 2024 8:11 pm

Since our backend is using Node.js, and our OD calls are made using Axios, I found this StackOverflow post that was able to solve the problem, so perhaps not an issue here at all.

justine
Posts: 175
Joined: Tue Dec 28, 2021 7:59 am

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Post by justine » Tue Mar 05, 2024 7:34 am

Good morning graham_mueller,

I apologize for the timeout misunderstanding. I'm glad you found a solution and shared it on the forums.

Thanks!

Post Reply