We are having trouble testing the ShortQueries.
Our API Patient GET requests are working
Our Short Query - PUT is not working. We are using a sample query provided in this page https://www.opendental.com/site/apiqueries.html and it gives the 400 BadRequest error
We are doing this for PUT URL: https://api.opendental.com/api/v1/queries/ShortQuery
We are doing this for the BODY:
{
"SqlCommand": "SELECT count(*) FROM Patients"
}
It does not seem to be a user permissions issue because our GET requests are working. There was another post where ShortQueries weren't working because of an outdated version - our OD version is 21.3 so we don't think that is the issue either. Any advice on what to check?
ShortQuery help
Re: ShortQuery help
What is the specific error message you are getting with the 400 BadRequest error? This will describe a number of SQL-related issues with the query you are trying to run.
For example, your SQL command should be "SELECT * FROM patient" (not plural "patients"). You are likely getting the an error message that states, "An SQL error occurred: Table 'patients' doesn't exist."
For example, your SQL command should be "SELECT * FROM patient" (not plural "patients"). You are likely getting the an error message that states, "An SQL error occurred: Table 'patients' doesn't exist."
-
- Posts: 11
- Joined: Mon Jan 31, 2022 8:51 am
Re: ShortQuery help
Thanks SLeon, the 400 BadRequest error doesn't give any additional information.
Strangely, we ended up just uninstalling OD and reinstalling and now the Short Queries are working fine.
So, I guess if anyone else is just getting started and having trouble with a 400 error - maybe try uninstalling and reinstalling
Strangely, we ended up just uninstalling OD and reinstalling and now the Short Queries are working fine.
So, I guess if anyone else is just getting started and having trouble with a 400 error - maybe try uninstalling and reinstalling

Re: ShortQuery help
I am glad you've got it working. That leads me to believe that there might have been an issue with the dental office's eConnector. When that is the case, it returns a 400 error and a "An error has occurred on the server" message.
To others that may encounter this issue, I would first make sure the eConnector is up to date. Restarting the eConnector service should resolve any issues at that point.
To others that may encounter this issue, I would first make sure the eConnector is up to date. Restarting the eConnector service should resolve any issues at that point.