Slot API error

For requests or help with our API
Post Reply
jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Slot API error

Post by jeychon » Sun Sep 11, 2022 11:41 am

OD version : 22.2.37 (updated 9/11/22)

Hello, The other APIs are working but when I try to use the API of GET//appointments/Slots.
I got 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."

So I just updated the OD version 22.2.37(most recent version)

But I still have error. and when I checked the log at the server. Server log is as below

"09/11/22 10:38:18:336 Message: Object reference not set to an instance of an object.
Function Name: ApptSearch : GetApiSlots
Is Exception: True
Application Log Level: Error
Entry Log Level: Error

Data Context:
DtoException -- dtoString: <?xml version="1.0" encoding="utf-16"?><DtoGetApiResponse2><Credentials><Username></Username><Password></Password><SessionToken></SessionToken></Credentials><MethodName></MethodName><TransmissionNum>0</TransmissionNum><Params /><RawRequest>[[34]]GET /api/v1/appointments/Slots HTTP/2\r\nHost: 10.10.11.183\r\nAuthorization: ODFHIR *******************************[[34]]</RawRequest></DtoGetApiResponse2>

Call Stack:
1 - ApptSearch : GetApiSlots
2 - Appointments : $
3 - Appointments : Process
4 - ApiMain : PassRequestToODApi
5 - ApiProcessor : HandleDtoGetApi2
"

Can you advise?

Thank you in advance.

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

Re: Slot API error

Post by SLeon » Mon Sep 12, 2022 8:53 am

Good morning,

This message from the eConnector logger file indicates that there was an issue with your eConnector service running. I have updated a test dental office to 22.2.37 as well, and am able to use the Appointments GET Slots endpoint successfully.

According to our records, your eConnector appears to run normally and made successful requests after this forum post. Are you still encountering an issue sending API requests?

We have replaced the API credentials in your post with asterisks to protect your privacy.

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

Re: Slot API error

Post by rinse-rey » Tue Sep 13, 2022 12:17 pm

We are having the same issue. Upgraded to new version 22.3.5 and API gives the same error.

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

Re: Slot API error

Post by SLeon » Tue Sep 13, 2022 2:22 pm

Updating to 22.3.6 will resolve this issue. There was problem with the eConnector that only impacted API customers using versions 22.3.4 and 22.3.5.

However, we generally advise against our customers updating to the first few versions of each beta release.

jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Re: Slot API error

Post by jeychon » Tue Sep 13, 2022 4:48 pm

Thank you so much for the follow up. but my version 22.2.37 still has the same problem. I used the API of 'appointments' instead of appointment/Slots.
Do I need to install beta version of 22.3.6?

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

Re: Slot API error

Post by rinse-rey » Tue Sep 13, 2022 7:29 pm

Upgrading the beta version works for me. Thanks for the help.

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

Re: Slot API error

Post by SLeon » Wed Sep 14, 2022 8:35 am

jeychon wrote:
Tue Sep 13, 2022 4:48 pm
Thank you so much for the follow up. but my version 22.2.37 still has the same problem. I used the API of 'appointments' instead of appointment/Slots.
Do I need to install beta version of 22.3.6?
We have just updated our public demo dental office to version 22.2.37 without issue. All API requests with these credentials are successful. Could you please include a copy of the API request you are sending (minus your credentials)? It could be a formatting issue.

jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Re: Slot API error

Post by jeychon » Fri Sep 16, 2022 2:12 pm

Please see my API request as below

Source code:
URL = f"{current_app.config['OD_API_REQUEST_URL']}/appointments/Slots?date=2022-09-19"
headers = {"Content-Type":"application/json",
"authorization":f"ODFHIR {current_app.config['OD_DEVELOPER_API_KEY']}/{current_app.config['OD_CUSTOMER_API_KEY']}"
}
res = requests.get(URL, headers=headers)

URL:
https://api.opendental.com/api/v1/appoi ... 2022-09-19

print(res.json()):
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.

justine
Posts: 168
Joined: Tue Dec 28, 2021 7:59 am

Re: Slot API error

Post by justine » Fri Sep 16, 2022 3:06 pm

jeychon wrote:
Fri Sep 16, 2022 2:12 pm
Please see my API request as below

Source code:
URL = f"{current_app.config['OD_API_REQUEST_URL']}/appointments/Slots?date=2022-09-19"
headers = {"Content-Type":"application/json",
"authorization":f"ODFHIR {current_app.config['OD_DEVELOPER_API_KEY']}/{current_app.config['OD_CUSTOMER_API_KEY']}"
}
res = requests.get(URL, headers=headers)

URL:
https://api.opendental.com/api/v1/appoi ... 2022-09-19

print(res.json()):
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.
Hello jeychon,

I'm not a Python developer but I was able to successfully send a request with your code snippet after removing the current_app.config references.

jeychon.jpg
jeychon.jpg (98.29 KiB) Viewed 2681 times

I am unfamiliar with current_app.config. Are you certain python is parsing and formatting correctly?

jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Re: Slot API error

Post by jeychon » Fri Sep 16, 2022 5:03 pm

No, Formatting is not a problem. Because I can get the data when I use 'appointments?date=2022-09-19' .

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

Re: Slot API error

Post by SLeon » Mon Sep 19, 2022 8:57 am

Good morning,

We are currently in the process of improving the error messages we return when API requests are incorrectly formatted. In select cases, we give the "Error. This is most likely a version issue..." message you have reported.

The reason we suggested you are receiving this message as a result of a request formatting issue is shown in the above screenshot. Our public demo dental office (whose credentials you see above) is on the same version of Open Dental as you: 22.2.37. You can see that we were able to successfully get time slots back when we ran the Appointment GET Slots method. We do not know what the rest of your application looks like, but I would hypothesize that the way current_app.config object works could be the culprit, as that is the only difference between our python snippet and yours.

Here are some things you could try to see if formatting is the issue:
- Make a request without using current_app.config, similar to above.
- Make a request with a different RESTful client.
- Change your 'OD_API_REQUEST_URL' to hold the entire API endpoint "https://api.opendental.com/api/v1/appoi ... 2022-09-19"
- Because you mention you are able to use appointments?date=2022-09-19 fine, but not appointments/Slots?date=2022-09-19, current_app might have an issue with the nonCrud element (/Slots). You could send a different API request that utilizes a nonCrud element, such as /patients/Simple?Birthdate=1950-06-01.

jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Re: Slot API error

Post by jeychon » Tue Sep 20, 2022 12:45 pm

Hello, Thank you for helping me out

I tried not to using current_app configuration.
Unfortunately, it did not help.

Also, I tried the other API such as "/patients/Simple?Birthdate=1950-06-01."
it worked. I can get the information.

I tried appointments?date=2022-0926
it worked.

Only when I add 'Slots', I got the same error.

Thank you for your help in advance.

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

Re: Slot API error

Post by SLeon » Tue Sep 20, 2022 2:58 pm

Thank you for confirming those details for us.

I was just able to reproduce this error in a very specific circumstance. It was when the Practice Default Provider was not assigned to any operatories, was scheduled for the day but not to any specific operatory, and did not specify an OpNum in the API requests. We will improve the message returned in this specific situation.

We always recommend supplying both the ProvNum for the provider you are interested in and the OpNum of an operatory they are scheduled in. Omitting the ProvNum from the API request will default the search to use your Practice Default Provider. Omitting an OpNum from the API request will default to the first operatory they are assigned to. If this is the issue you are running into, make sure the provider is assigned and/or scheduled in an operatory. Again, I would recommend specifying both in the request like this: appointments/Slots?date=2022-09-20&ProvNum=1&OpNum=1, assuming Provider 1 is assigned to and scheduled in Operatory 1.

jeychon
Posts: 6
Joined: Sun Sep 11, 2022 11:33 am

Re: Slot API error

Post by jeychon » Wed Sep 21, 2022 10:54 am

SLeon,

Appreciate for your help, I solved your problem. Yes you are right. I assigned the operatory to provider and add OpNum, ProvNum. I could get the information of Slot.

Really appreciate for your support and take care of the solution.

Thank you.

Post Reply