Getting 401 while accessing Azure Health Data Service - FHIR service using postman

P, Pioline (Cognizant) 195 Reputation points
2023-05-18T10:31:51.77+00:00

I have created Azure Health Data Services - FHIR Service under subscription with Client app registration done and FHIR data contributor access provided.

I followed these steps (https://learn.microsoft.com/en-us/azure/healthcare-apis/fhir/use-postman) for making GET / POST request using postman.

However, I am getting unauthorised response while making GET / POST request through postman.

Kindly help me out!

Azure Health Data Services
Azure Health Data Services
An Azure offering that provides a suite of purpose-built technologies for protected health information in the cloud.
155 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasimTamboli 4,785 Reputation points
    2023-05-19T03:38:24.6733333+00:00

    If you are receiving a 401 Unauthorized response while making GET or POST requests to the Azure Health Data Service - FHIR service using Postman, it indicates that there is an issue with the authentication or authorization process. Here are a few troubleshooting steps you can try:

    Check the access permissions: Ensure that the client app registration you created has the necessary permissions and roles assigned. In Azure portal, navigate to your Azure AD tenant, locate the app registration, and verify that it has the required roles like "FHIR Data Contributor" assigned.

    Validate the authentication token: Make sure you are including the correct authentication token in the request headers. Double-check that you have obtained a valid access token from Azure Active Directory using the client credentials grant flow.

    Verify the request headers: Confirm that you are including the necessary headers in your Postman request. The Authorization header should have the value "Bearer {access_token}" where {access_token} is the token you obtained. Additionally, ensure that the Content-Type header is set to "application/fhir+json" for FHIR requests.

    Review the endpoint URL: Check that the URL you are using in Postman is correct and matches the Azure Health Data Service - FHIR endpoint. It should be in the format: https://{fhir-service-name}.azurehealthcareapis.com/{resource}.

    Validate the FHIR resource path: Ensure that the resource path you are using in the request URL is valid. For example, if you are performing a GET request, make sure the path corresponds to an existing FHIR resource.

    Check network connectivity: Verify that you have a stable internet connection and there are no network restrictions or firewalls blocking the requests.