# Retrieving Referrals for review in INT (A008, FHIR STU3)

**URL:** <https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077>\
**Category:** e-Referral Service FHIR API\
**Tags:** fhir\
**Created:** [10 March 2026 16:44 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077 "2026-03-10T16:44:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tc1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tc1/32/83_2.png) [@tc1](https://developer.community.nhs.uk/u/tc1)\
**Post date:** [10 March 2026 16:44 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/1 "2026-03-10T16:44:01Z")

</div>

We’ve got set up with trust and GP roles in the INT environment, and are now getting our code that worked in the sandbox to retrieve referrals sent to the trust in INT.

No matter what I do I seem to get a 401 error back from the query. I don’t think this can be a problem with the auth token, as it worked OK querying the sandbox.

I wonder if our API token needs to be granted access to our INT trust / service ? Our ERS service id that we set up in the trust is 6711327

Our most recent correlation id was 92c64e6e-b59c-43f3-9648-c112dd11c7f8

---

<div class="post-metadata">

**Author:** ![tony.marsh1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tony.marsh1/32/855_2.png) [@tony.marsh1](https://developer.community.nhs.uk/u/tony.marsh1)\
**Post date:** [10 March 2026 17:21 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/2 "2026-03-10T17:21:25Z")

</div>

Hi @tc1 Have you onboarded with us and followed the steps here? Please have a read through, if you have not already.

[https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-2-build](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-2-build)

If you have - do you have an application ID

---

<div class="post-metadata">

**Author:** ![tc1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tc1/32/83_2.png) [@tc1](https://developer.community.nhs.uk/u/tc1)\
**Post date:** [11 March 2026 09:39 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/3 "2026-03-11T09:39:41Z")

</div>

Yup, the application id is 476f2265-5f93-4379-8472-571a36dbb459

---

<div class="post-metadata">

**Author:** ![tony.marsh1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tony.marsh1/32/855_2.png) [@tony.marsh1](https://developer.community.nhs.uk/u/tony.marsh1)\
**Post date:** [11 March 2026 11:17 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/4 "2026-03-11T11:17:24Z")

</div>

> [@tc1](#):
>
> 476f2265-5f93-4379-8472-571a36dbb459

Hi TC1 - this will need a DEV to check the 401 correlation ID - did anything else come up in the error - any additional message?

This is an app restricted endpoint - so imporant that you are referring into the trust provided via the test data - in which this case is H3G9K

---

<div class="post-metadata">

**Author:** ![tc1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tc1/32/83_2.png) [@tc1](https://developer.community.nhs.uk/u/tc1)\
**Post date:** [12 March 2026 08:55 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/5 "2026-03-12T08:55:42Z")

</div>

Yup, I’m attempting to use H3G9K so the query looks like

```auto
{
	"name": "service",
	"valueIdentifier": {
			"system": "http://fhir.nhs.net/Id/ers-service",
			"value": "6711327"
	}
}

```

Thanks for engaging with someone there to find out why it’s failing. I think I’m just getting the 401 error without any body.

---

<div class="post-metadata">

**Author:** ![George\_Craft](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@George\_Craft](https://developer.community.nhs.uk/u/George_Craft)\
**Post date:** [12 March 2026 09:43 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/6 "2026-03-12T09:43:46Z")

</div>

Good Morning, I am having a look through this now.

---

<div class="post-metadata">

**Author:** ![George\_Craft](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@George\_Craft](https://developer.community.nhs.uk/u/George_Craft)\
**Post date:** [12 March 2026 10:07 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/7 "2026-03-12T10:07:24Z")

</div>

Hi tc1,

Thanks for the detail so far, there are a couple of things that i believe would help us investigate further:

1. Could you share the full request headers you’re sending? This will help us rule out any formatting issues on the auth token and confirm all the required NHS headers are present.

2. Have you explicitly contacted [england.nhserspartners@nhs.net](mailto:england.nhserspartners@nhs.net) to request that the relevant e-RS interactions are added to your INT application (app ID: 476f2265-5f93-4379-8472-571a36dbb459)? This doesn’t happen automatically when moving from sandbox to INT, and is a common cause of exactly this kind of 401 with no response body.

Thanks,

George

---

<div class="post-metadata">

**Author:** ![tc1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tc1/32/83_2.png) [@tc1](https://developer.community.nhs.uk/u/tc1)\
**Post date:** [12 March 2026 10:36 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/8 "2026-03-12T10:36:28Z")

</div>

Here’s the full headers:

`{"Accept":"application/fhir+json","Content-Type":"application/fhir+json","authorization":"Bearer zT6NCTflzURLSirZfoS80e903YLG","x-correlation-id":"25627c78-d848-4af7-b0a6-c5bb3f0f3f7e","User-Agent":"axios/1.13.2","Content-Length":"407","Accept-Encoding":"gzip, compress, deflate, br"}`

And body

`{“resourceType”:“Parameters”,“meta”:{“profile”:[“``https://fhir.nhs.uk/STU3/StructureDefinition/eRS-FetchWorklist-Parameters-1"]},“parameter”:[{“name”:“listType”,“valueCodeableConcept”:{“coding”:[{“system”:“https://fhir.nhs.uk/STU3/CodeSystem/eRS-ReferralListSelector-1”,“code”:“REFERRALS_FOR_REVIEW”}]}},{“name”:“service”,“valueIdentifier”:{“system”:“http://fhir.nhs.net/Id/ers-service”,“value”:"6711327”``}}]}`

I’d not added the JSON key to the application in the onboarding site, I have now but no change even after waiting a little while.

I’ve just emailed in the details of our app id and public key URL.  
For what it’s worth the docs at [https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication#step-3-register-your-public-key-with-us](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication#step-3-register-your-public-key-with-us) say to only contact for production access.

---

<div class="post-metadata">

**Author:** ![George\_Craft](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@George\_Craft](https://developer.community.nhs.uk/u/George_Craft)\
**Post date:** [12 March 2026 11:50 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/9 "2026-03-12T11:50:42Z")

</div>

There are no problems I can see with the Headers and Body, I think for now it is best to wait to hear what the partners come back with. Apologies for the inconvenience caused.

---

<div class="post-metadata">

**Author:** ![Hannah\_Smith](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hannah\_Smith](https://developer.community.nhs.uk/u/Hannah_Smith)\
**Post date:** [12 March 2026 14:07 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/10 "2026-03-12T14:07:24Z")

</div>

Hi both, I’ve checked the application 476f2265-5f93-4379-8472-571a36dbb459 and it is set up correctly for e-RS - Application-restricted. I can also confirm the ASID linked has the latest e-RS interactions.

---

<div class="post-metadata">

**Author:** ![tc1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tc1/32/83_2.png) [@tc1](https://developer.community.nhs.uk/u/tc1)\
**Post date:** [13 March 2026 09:21 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/11 "2026-03-13T09:21:25Z")

</div>

I think I may have had the wrong iss/sub in the JWT payload sent to [https://int.api.service.nhs.uk/oauth2](https://int.api.service.nhs.uk/oauth2) to get a bearer token. I’ve re-copied from the developer portal, and things are a lot healthier.  
Thanks for helping to rule out a bunch of other things.

Is the security modal going to be the same for live, so once we’ve completed the onboarding all we need from a partner trust is their eRS service ID to retrieve work lists ?

---

<div class="post-metadata">

**Author:** ![tony.marsh1](https://dub1.discourse-cdn.com/nhsdigitaldeveloper/user_avatar/developer.community.nhs.uk/tony.marsh1/32/855_2.png) [@tony.marsh1](https://developer.community.nhs.uk/u/tony.marsh1)\
**Post date:** [17 March 2026 13:37 UTC](https://developer.community.nhs.uk/t/retrieving-referrals-for-review-in-int-a008-fhir-stu3/11077/12 "2026-03-17T13:37:09Z")

</div>

Essentially the model is the same in INT as it is for PROD -its a live like environment.

Once a supplier is live they provide new applications for PROD - if you’re healthcare work AND application restricted then this is x2 applications. For application restricted there is a further governance form to complete - and we utilise the ODS code of the connecting NHS Trust, as well as a smartcard associated with that Trust. This means that only referrals associated within this org, an important protective measure. But you’d follow the same pattern if you are using the worklist endpoint.

A little more on assurance section 3.1 [https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-3-assure](https://digital.nhs.uk/services/e-referral-service/api/integration-process/stage-3-assure)

Relevant to your use case if you’re application restricted is

“In order to use this endpoint you must be an authenticated e-RS calling application, working in the context of a Service Provider Organisation.

Supported Worklists:

- Referrals for Review

- Appointment Slot Issues

The Service filter is mandatory when using this security pattern.

This endpoint must only be used to retrieve the worklist for a given service up to two times per day. If this does not meet your requirements, please [contact us](https://digital.nhs.uk/developer/help-and-support) to discuss your use case.

If a worklist response exceeds 10MB, a successful response will not be returned. This is due to the size limitation on the APIM platform.”
