API: Searching patient with apostrophe in name throws error

For requests or help with our API
Post Reply
saravanan
Posts: 6
Joined: Fri Sep 23, 2022 9:01 am

API: Searching patient with apostrophe in name throws error

Post by saravanan » Mon May 08, 2023 12:41 am

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?

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

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

Post by SLeon » Mon May 08, 2023 9:49 am

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

saravanan
Posts: 6
Joined: Fri Sep 23, 2022 9:01 am

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

Post by saravanan » Tue May 09, 2023 2:39 am

Thanks, "/patients/Simple" works as expected, I will change to use it instead of multiple.

Post Reply