Page 1 of 1

ECONNRESET when attempting PUT ShortQuery with Offset

Posted: Mon Mar 04, 2024 2:16 pm
by graham_mueller
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?

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Posted: Mon Mar 04, 2024 2:51 pm
by justine
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!

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Posted: Mon Mar 04, 2024 3:01 pm
by graham_mueller
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.

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Posted: Mon Mar 04, 2024 8:11 pm
by graham_mueller
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.

Re: ECONNRESET when attempting PUT ShortQuery with Offset

Posted: Tue Mar 05, 2024 7:34 am
by justine
Good morning graham_mueller,

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

Thanks!