A005 with Application restricted Access

Hi,
I’ve been trying to get e-RS attachments A005, A042, A007 working with application restricted access; it was previously working with user restricted but we wanted to make this change. We’ve recently had a new INT application set up to this effect which was linked to our existing Org in INT (S7L0W) that already has an endpoint configured for e-RS HL7v3 messaging. We needed to extend this Org to use e-RS APIs so we can look towards full integration testing including existing interfaces.

After the new INT application was set up I’ve given it a go and I’m getting an error which I’m not sure about; I’m not sure whether it’s an issue with the Apigee setup or my request message (headers or token). Any advice would be appreciated.

Request

Host = “int.api.service.nhs.uk/referrals/FHIR

Path = “STU3/ReferralRequest/000049819286”

Headers = {{accept|application/fhir+json}|{NHSD-eRS-Business-Function|SERVICE_PROVIDER_CLINICIAN}|{NHSD-Application-Restricted-ODS-Code|S7L0W}|{X-Correlation-ID|68aa0212-7492-4081-b041-338b0bba3008}}

Token = “xxxxxxxxxxxx”

Response

“HTTPERR”,

“500”,

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

{HTTP/1.1 500 Internal Server Error|Date:Tue, 03 Feb 2026 12:33:11 GMT|Content-Type:application/json|Content-Length:130|Connection:keep-alive|Strict-Transport-Security:max-age=31536000; includeSubDomains|X-Correlation-ID:68aa0212-7492-4081-b041-338b0bba3008}

Hi @sgroom ,

For application restricted access, you will need to replace Token with

Authorization = Bearer [access_token]

There is more info here: e-Referral Service - FHIR API - NHS England Digital if needed.

Thanks,

Ed

@Ed_Wills
Hi,
Sorry that message I sent must have been a version where I was playing about trying to get it to work, below is an example with the token in the header. I think this is how it was previously working with User Restricted Access:

{GET /referrals/FHIR/STU3/ReferralRequest/000049819286 HTTP/1.1|accept: application/fhir+json|NHSD-eRS-Business-Function: SERVICE_PROVIDER_CLINICIAN|NHSD-Application-Restricted-ODS-Code: S7L0W|X-Correlation-ID: 02abd557-4bf7-4552-80c3-4d33eb955b1d|Authorization: Bearer dzDPkN4P71SJOczM9JhCfuZCruFr|Host: int.api.service.nhs.uk|}

I’m still getting the same error:
“{“fault”:{“faultstring”:“Unresolved variable : app.app-restricted-ods-code”,“detail”:{“errorcode”:“entities.UnresolvedVariable”}}}”