ECONNRESET when attempting PUT ShortQuery with Offset
-
- Posts: 44
- Joined: Fri Jan 19, 2024 10:57 am
ECONNRESET when attempting PUT ShortQuery with Offset
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
Good afternoon graham_mueller,graham_mueller wrote: ↑Mon Mar 04, 2024 2:16 pmI 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?
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!
-
- Posts: 44
- Joined: Fri Jan 19, 2024 10:57 am
Re: ECONNRESET when attempting PUT ShortQuery with Offset
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.
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.
-
- Posts: 44
- Joined: Fri Jan 19, 2024 10:57 am
Re: ECONNRESET when attempting PUT ShortQuery with Offset
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
Good morning graham_mueller,
I apologize for the timeout misunderstanding. I'm glad you found a solution and shared it on the forums.
Thanks!
I apologize for the timeout misunderstanding. I'm glad you found a solution and shared it on the forums.
Thanks!