Offset for Queries PUT ShortQuery

For requests or help with our API
Post Reply
greg.merrill
Posts: 3
Joined: Thu Jul 07, 2022 9:48 am

Offset for Queries PUT ShortQuery

Post by greg.merrill » Thu Sep 22, 2022 4:46 pm

Hi Open Dental Support Team,

I have been using Queries PUT ShortQuery along with the following JSON

Code: Select all

{
  "SqlCommand": "SELECT * FROM appointmenttype"
}
in order to get all appointment types. This works great for practices with less than 100 appt types. To handle the edge case where there is more than 100, it says in the documentation(https://www.opendental.com/site/apiqueries.html) that the Offset query param should still work with these types of requests. However, when I add an ?Offset=100 to the URL using ARC, the modified request seems to ignore the Offset value entirely and sends back the original number of appointment types, whereas I would expect it to send back an empty array since I have less than 100 appointment types saved in Open Dental.

Since this will be an edge case for us most of the time, I'm hoping I can continue using the PUT method rather than switching to the POST method. Am I doing something wrong with the Offset query param to be getting this unexpected behavior?

Thanks,
Greg

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

Re: Offset for Queries PUT ShortQuery

Post by justine » Fri Sep 23, 2022 8:05 am

greg.merrill wrote:
Thu Sep 22, 2022 4:46 pm
Hi Open Dental Support Team,

I have been using Queries PUT ShortQuery along with the following JSON

Code: Select all

{
  "SqlCommand": "SELECT * FROM appointmenttype"
}
in order to get all appointment types. This works great for practices with less than 100 appt types. To handle the edge case where there is more than 100, it says in the documentation(https://www.opendental.com/site/apiqueries.html) that the Offset query param should still work with these types of requests. However, when I add an ?Offset=100 to the URL using ARC, the modified request seems to ignore the Offset value entirely and sends back the original number of appointment types, whereas I would expect it to send back an empty array since I have less than 100 appointment types saved in Open Dental.

Since this will be an edge case for us most of the time, I'm hoping I can continue using the PUT method rather than switching to the POST method. Am I doing something wrong with the Offset query param to be getting this unexpected behavior?

Thanks,
Greg
Good morning Greg,

I will look into this for you. I tested ShortQuery and offset does work if there are more than 100 items in the return object.

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: Offset for Queries PUT ShortQuery

Post by SLeon » Mon Oct 17, 2022 9:51 am

Good morning Greg,

We have fixed the issue you described in your post above. Using the ?Offset=100 parameter for queries with fewer than 100 results will now return an empty list as one would expect. This change will be available starting in versions 22.2.43 and 22.3.14.

Post Reply