401 error when try to get access token

I have successfully configured an application in OpenEMR. Using the application’s Client ID and Client Secret, I was able to authorize it through ${openemr-url}/swagger/#/ and log in without any issues after selecting all available scopes.

However, while the FHIR API endpoints are functioning correctly, attempts to access the standard OpenEMR API result in a 401 Unauthorized error. Could you please clarify why this is occurring?

@anil_sharma can you post a screenshot or more details on how you got to the 401? Did you follow the API README.

I have obtained the access token, but when I try to pass it on…http it gives 401

A 401 is usually a scope issue i.e scope is missing to auth the request you want or wrong scope.

I believe we give a different error if a scope is mangled but I’m not 100% on that.