Page 1 of 1

API: Searching patient with apostrophe in name throws error

Posted: Mon May 08, 2023 12:41 am
by saravanan
Searching for patient with apostrophe in the name results in following error:

>> "Error. This is most likely a version issue. The version that the customer is using might be too old to support the API method used."

Last name has apostrophe like O'Connor, when searching for patient with this name, results in error.

Code: Select all

 https://api.opendental.com/api/v1/patients?LName=O%27Connor 
Does this required any extra handling in quoting the URL?

Re: API: Searching patient with apostrophe in name throws error

Posted: Mon May 08, 2023 9:49 am
by SLeon
This issue is a product of the Patients GET (multiple) using the exact same query as the Patient Select query as in Open Dental. We will look into how we can fix this programmatically, but there are two ways you can get around this right now.

1. Escape the apostrophe with a '\' character. When encoded this will look like

Code: Select all

https://api.opendental.com/api/v1/patients?LName=O%5C%27Connor
2. Use Patients GET Simple instead

Code: Select all

https://api.opendental.com/api/v1/patients/Simple?LName=O%27Connor

Re: API: Searching patient with apostrophe in name throws error

Posted: Tue May 09, 2023 2:39 am
by saravanan
Thanks, "/patients/Simple" works as expected, I will change to use it instead of multiple.