401 Unauthorized | Need help to GET & POST users/encounter for my app

We are getting 401 Unauthorized when trying to POST an encounter. We have put the following scopes for our app:

[ openid api:oemr api:fhir api:port user/allergy.read user/allergy.write user/appointment.read user/appointment.write user/dental_issue.read user/dental_issue.write user/document.read user/document.write user/drug.read user/encounter.read user/encounter.write user/facility.read user/facility.write user/immunization.read user/insurance.read user/insurance.write user/insurance_company.read user/insurance_company.write user/insurance_type.read user/list.read user/medical_problem.read user/medical_problem.write user/medication.read user/medication.write user/message.write user/patient.read user/patient.write user/practitioner.read user/practitioner.write user/prescription.read user/procedure.read user/soap_note.read user/soap_note.write user/surgery.read user/surgery.write user/vital.read user/vital.write user/AllergyIntolerance.read user/CareTeam.read user/Condition.read user/Encounter.read user/Immunization.read user/Location.read user/Medication.read user/MedicationRequest.read user/Observation.read user/Organization.read user/Organization.write user/Patient.read user/Patient.write user/Practitioner.read user/Practitioner.write user/PractitionerRole.read user/Procedure.read patient/encounter.read patient/patient.read patient/Encounter.read patient/Patient.read ]

Standard APIs are not working for us (neither GET or POST). Only FHIR APIs are working but unable to POST using FHIR as no scope.

Image reference:

Need some help with this!

@Devjeet_Choudhury Share the error log here

The APIs are not being called from the backend thus no logs.

For now, we are just simply testing on postman by passing the token. Shared the screenshot of the postman.

@Devjeet_Choudhury keys are generating or not ?

If you meant “access token” - then YES.

We are able to fetch information using FHIR APIs as of now. But not the standard openEMR APIs like api/facility etc.

@Devjeet_Choudhury public key and private key I am talking

If you’re facing issues with OpenEMR, this document will guide you through resolving them effectively:

  1. Start by registering a client using Postman.
  2. Use that client to generate an access token.
  3. With the access token, you can begin making API calls.

The document also outlines the available scopes for the standard API, which you can review for more control and customization.

:page_facing_up: OpenEMR REST API Documentation

Can you please share the link of OpenEMR Rest API Documentation? It is not accessible.

@Paras12 Please find below link OpenEMR 7.0.1 API - OpenEMR Project Wiki

1 Like