Page 1 of 1

Offset for Queries PUT ShortQuery

Posted: Thu Sep 22, 2022 4:46 pm
by greg.merrill
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

Re: Offset for Queries PUT ShortQuery

Posted: Fri Sep 23, 2022 8:05 am
by justine
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.

Re: Offset for Queries PUT ShortQuery

Posted: Mon Oct 17, 2022 9:51 am
by SLeon
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.