Local API issue

For requests or help with our API
Post Reply
rinse-rey
Posts: 23
Joined: Tue Sep 13, 2022 12:15 pm

Local API issue

Post by rinse-rey » Wed Nov 16, 2022 12:03 pm

Hi there,

There is weird behavior while using the local api(https://www.opendental.com/site/apilocal.html)

I'm creating an appointment using the api api/v1/appointments/.
The body of the POST request is

Code: Select all

{
    "PatNum": 2,
    "Op": 1,
    "AptDateTime": "2022-12-06 11:00:00",
    "AppointmentTypeNum": 1,
    "IsNewPatient": "false",
    "IsHygiene": "false"
}
The problem is that when using the local API the length of the scheduled appointment is incorrect. However, if we use the regular od API( https://api.opendental.com) the length of the appointment is the one defined in the AppointmetType.
Basically, the body request doesn't change. What changes is the address of the request.

It seems this is some kind of bug. Let me know if you want more info, like the machine IP etc.

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

Re: Local API issue

Post by SLeon » Wed Nov 16, 2022 2:35 pm

Good afternoon,

I understand that the same JSON body is producing different results when sent to different endpoints (Local API "http://localhost:30222/api/v1/appointments" vs Remote API "https://api.opendental.com/api/v1/appointments").

Could you please verify a few details when using the Local API?
  • Exactly one instance of Open Dental running to process the request.
  • The version of Open Dental on the workstation is the same as the eConnector's server's version. (ie, no version mismatches)
  • (Unlikely) The database chosen on the workstation is the same as the database utilized by the eConnector.
Also, is the pattern the only incorrect component? Are the other components of the AppointmentType being set as expected?

rinse-rey
Posts: 23
Joined: Tue Sep 13, 2022 12:15 pm

Re: Local API issue

Post by rinse-rey » Thu Nov 17, 2022 5:39 am

You are correct, the same body json is producing different outputs when using both endpoints.

- Only one Open Dental Instance is running(double-checked that).
- OD version is 22.3.21.0. EConnector version is the same(I found the version looking at the Properties in the EConnector.exe). The picture is in the attachments.
- I don't know how to look into this.

The pattern is not the only different field, also ProcDescript and ProvAbbr

The response using the local API is:

Code: Select all

{
    "AppointmentTypeNum": 1,
    "AptDateTime": "2022-12-06 11:00:00",
    "AptNum": 1359,
    "AptStatus": "Scheduled",
    "ClinicNum": 0,
    "colorOverride": "0,0,0",
    "confirmed": "Unconfirmed",
    "Confirmed": 19,
    "DateTimeArrived": "0001-01-01 00:00:00",
    "DateTimeAskedToArrive": "0001-01-01 00:00:00",
    "DateTimeDismissed": "0001-01-01 00:00:00",
    "DateTimeSeated": "0001-01-01 00:00:00",
    "DateTStamp": "2022-11-17 05:26:52",
    "IsHygiene": "false",
    "IsNewPatient": "false",
    "NextAptNum": 0,
    "Note": "",
    "Op": 1,
    "PatNum": 2,
    "Pattern": "///XXXXXXXXXXXXXXXXXX///",
    "Priority": "Normal",
    "ProcDescript": "CompX, FMX, 3DImage, PanC, Prophy",
    "provAbbr": "Rana",
    "ProvHyg": 0,
    "ProvNum": 8,
    "unschedStatus": "",
    "UnschedStatus": 0
}

The response using the global API is:

Code: Select all

{
    "AppointmentTypeNum": 1,
    "AptDateTime": "2022-12-06 11:00:00",
    "AptNum": 1360,
    "AptStatus": "Scheduled",
    "ClinicNum": 0,
    "colorOverride": "0,0,0",
    "confirmed": "Unconfirmed",
    "Confirmed": 19,
    "DateTimeArrived": "0001-01-01 00:00:00",
    "DateTimeAskedToArrive": "0001-01-01 00:00:00",
    "DateTimeDismissed": "0001-01-01 00:00:00",
    "DateTimeSeated": "0001-01-01 00:00:00",
    "DateTStamp": "2022-11-17 05:27:39",
    "IsHygiene": "false",
    "IsNewPatient": "false",
    "NextAptNum": 0,
    "Note": "",
    "Op": 1,
    "PatNum": 2,
    "Pattern": "///XXXXXXXXXXXX///",
    "Priority": "Normal",
    "ProcDescript": "CompX, FMX, 3DImage, PanC, Prophy, FMP",
    "provAbbr": "Dr. Rana",
    "ProvHyg": 0,
    "ProvNum": 8,
    "unschedStatus": "",
    "UnschedStatus": 0
}
Attachments
Screen Shot 2022-11-17 at 9.33.57 AM.png
Screen Shot 2022-11-17 at 9.33.57 AM.png (696.55 KiB) Viewed 1428 times

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

Re: Local API issue

Post by SLeon » Thu Nov 17, 2022 8:02 am

(Unlikely) The database chosen on the workstation is the same as the database utilized by the eConnector.
You can check the database used by the Local API when it is launched with Open Dental:
ChooseDatabase.gif
ChooseDatabase.gif (25.69 KiB) Viewed 1420 times

And the database used by the eConnector (and therefore the Remote API) in \\OpenDental\OpenDentalEConnector\OpenDentalWebConfig.xml:
ConfigFile.gif
ConfigFile.gif (31.56 KiB) Viewed 1420 times

We were unable to duplicate this difference when using the Local and Remote API modes. There are other troubleshooting steps I can provide if you are instead using the API Service versus the Local API mode.

rinse-rey
Posts: 23
Joined: Tue Sep 13, 2022 12:15 pm

Re: Local API issue

Post by rinse-rey » Thu Nov 17, 2022 11:43 am

I checked both databases and the name matches.

What other steps we can do to troubleshoot the issue?

I can also give you the machine IP and the credentials so you can test it. If you want it, please ping me in the internal chat or by email.

rinse-rey
Posts: 23
Joined: Tue Sep 13, 2022 12:15 pm

Re: Local API issue

Post by rinse-rey » Fri Nov 18, 2022 7:42 am

The solution that worked was restarting the ApiService from the service manager.

Thanks to the team again.

Post Reply