The remote server returned an error: (500) Internal Server Error

This forum is for programmers who have questions about the source code.
Post Reply
mmanshad
Posts: 2
Joined: Wed Apr 21, 2021 12:56 pm

The remote server returned an error: (500) Internal Server Error

Post by mmanshad » Wed Apr 21, 2021 2:05 pm

I am able to successfully access OD API via Tester credentials through C# without issues, using the code below:

Code: Select all

            string authorizationHeader = "Authorization: ODFHIR NFF6i0KrXrxDkZHt/VzkmZEaUWOjnQX2z";
            WebRequest request = WebRequest.Create("https://api.opendental.com/api/v1/patients");
            
            request.Method = "GET";
            
            request.Headers.Add(authorizationHeader);
            request.ContentType = "application/json";

            WebResponse response = request.GetResponse();
            Console.WriteLine(((HttpWebResponse)response).StatusDescription);

            using (Stream dataStream = response.GetResponseStream())
            {
                StreamReader reader = new StreamReader(dataStream);
                string responseFromServer = reader.ReadToEnd();
                Console.WriteLine(responseFromServer);
            }

            response.Close();
However, I am now wanting to access my OD server installed locally but I receive "The remote server returned an error: (500) Internal Server Error" error when I use the same code after changing DeveloperKey/CustomerKey in the authorization header accordingly.

When I execute the same request in PostMan I receive:

Code: Select all

"Message": "An error has occurred."
I am running Windows 10 with OD version 20.5.47.0: What can I do to debug this issue?

Any help would be greatly appreciated!
Last edited by mmanshad on Thu Apr 22, 2021 9:30 am, edited 3 times in total.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: The remote server returned an error: (500) Internal Server Error

Post by jordansparks » Wed Apr 21, 2021 4:33 pm

That's not a very helpful message. We'll try to improve that. Open Dental must be version 21.1. I suspect that's the main problem.
Jordan Sparks, DMD
http://www.opendental.com

mmanshad
Posts: 2
Joined: Wed Apr 21, 2021 12:56 pm

Re: The remote server returned an error: (500) Internal Server Error

Post by mmanshad » Wed Apr 21, 2021 5:17 pm

Do you have data on which version of OD dental clinics who have 3rd party services use?

poonam
Posts: 20
Joined: Mon Aug 24, 2020 1:17 pm

Slow response in Patient get API

Post by poonam » Thu Dec 30, 2021 3:13 pm

Hi,
I have set up an API to populate all the patient in the list, but the response time of this Get query is too bad.
I wanted to understand that is there any way I can increase the performance?

Currently it is very poor, for database of 200 patient, it is taking more than 2 minutes to get the response.

Thanks,
Poonam

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

Re: The remote server returned an error: (500) Internal Server Error

Post by SLeon » Mon Jan 03, 2022 1:53 pm

Poonam,

How are you requesting this list of patients? Are you using the Patients GET (multiple), Queries POST, or Queries PUT ShortQuery API method?

poonam
Posts: 20
Joined: Mon Aug 24, 2020 1:17 pm

Re: The remote server returned an error: (500) Internal Server Error

Post by poonam » Mon Jan 17, 2022 7:58 am

Hi,
I am using simple Get request to get all patient data.

Thanks,
Poonam

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: The remote server returned an error: (500) Internal Server Error

Post by jordansparks » Tue Jan 18, 2022 6:41 pm

It's giving them to you in batches of 100 at a time, right? Because there's a hard limit of 100. So are you saying it's 1 minute for each request?
Jordan Sparks, DMD
http://www.opendental.com

Post Reply