A005 - Error Unresolved variable : app.app-restricted-ods-code

Hello,

We are trying to validate our connectivity to eRS API in e-RS INT environment for the following endpoint A005 – Retrieve Referral Request

e.g. https://int.api.service.nhs.uk/referrals/FHIR/STU3/ReferralRequest/9000000009

However we are getting the below response in return when hitting the endpoint

{“fault”:{“faultstring”:“Unresolved variable : app.app-restricted-ods-code”,“detail”:{“errorcode”:“entities.UnresolvedVariable”}}}

With PDS API we are getting the below response (https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9691927349)

{

**"resourceType": "OperationOutcome",** 

**"issue": \[** 

    **{** 

        **"severity": "error",** 

        **"code": "forbidden",** 

        **"details": {** 

            **"coding": \[** 

                **{** 

                    **"system": "https://fhir.nhs.uk/R4/CodeSystem/Spine-ErrorOrWarningCode",** 

                    **"version": "1",** 

                    **"code": "ACCESS_DENIED",** 

                    **"display": "Access Denied - Unauthorised"** 

                **}** 

            **\]** 

        **},** 

        **"diagnostics": "Invalid API call as no apiproduct match found"** 

    **}** 

**\]** 

}

Can you please advise on what is that we are missing?

Hello,

This will be because there is no application-restricted application set up.

A similar answer was posted here.

@nila.surti3 is this something which can be looked into please.

Thanks,
Balal

Hi

Please can you provide the application name and ID you are using when trying to use A005 please as our records indicate you have both an app-erstricted and user-restricted application set up in INT.

Kind regards

Nila

@BalalSaleh, there is already an app-restricted application set up. Can you help further please?

Thanks

Nila

Hi,

Where did you get this referral from: 9000000009?

Is this something that you have created?

What steps have you followed prior to making the call to this API?

These answers will help us investigate this.

Thanks,
Balal

@BalalSaleh The referral 9000000009 is obtained from Sandbox environment

We have created the jwt token as per the documentation

Used the JWT to obtain an Access token which was successful

We then used access token within the authorisation header

We also added the app-restricted-ods-code header with the correct value, when making the API call

Below the curl for our request

curl --location ‘https://int.api.service.nhs.uk/referrals/FHIR/STU3/ReferralRequest/9000000009’
–header ‘app-restricted-ods-code: [REDACTED]’
–header ‘x-correlation-id: 33128c94-6f64-45f8-9a47-c839b28460e8’
–header ‘Authorization: ••••••’

@BalalSaleh Is there any update on the above please?

Hello Medefer Developer,

Using the the referral from Sandbox environment is the incorrect way to use the API.

Have you tried using a different referral which is not from the sandbox testing environment to use?

Thanks,
Balal

@BalalSaleh I can certainly try that.

FYI, we are expecting a 404 response as this referral would not be found in INT environment, however we are getting a 500 response with below response body

{

"fault": {

    "faultstring": "Unresolved variable : app.app-restricted-ods-code",

    "detail": {

        "errorcode": "entities.UnresolvedVariable"

    }

}

}

FYI, We have also tried the A008 endpoint and get the same error response

@BalalSaleh I have tried with UBRN 000049813801 which is a test one I have created in INT environment and still get the same error

@nila.surti3 Any update on the above please?

@nhserspartners from investigating the information the API endpoint is working as expected, the reply from the Endpoint is stemming towards a set up/configuration issue for @Medefer_Developer’s application. Can this be investigated further please?

Will do - leave it with me

@BalalSaleh We have corrected the set up issue. @Medefer_Developer Can you please confirm if you are still getting a 500 response?