I’m trying to attach an upload to an A&G request, using https://digital.nhs.uk/developer/api-catalogue/e-referral-service-fhir#post-/STU3/CommunicationRequest/-ubrn-/$ers.sendCommunicationToRequester
I’ve got an an id back from the main upload API, against ‘NHSD-eRS-Referral-ID’ being the A&G UBRN
From the docs, it looks like I just add a guidanceAttachmentFile to the parameter array, right ?
My request is
{"meta":{"profile":["https://fhir.nhs.uk/STU3/StructureDefinition/eRS-SendCommunicationToRequester-Request-Parameters-1"]},"resourceType":"Parameters","parameter":[{"name":"guidanceOutcome","valueCoding":{"system":"https://fhir.nhs.uk/STU3/CodeSystem/eRS-GuidanceResponseOutcome-1","code":"REQUIRE_FURTHER_INFORMATION"}},{"name":"guidance","valueString":"with"},{"name":"updatedPriority","valueCoding":{"system":"https://fhir.nhs.uk/STU3/CodeSystem/eRS-Priority-1","code":"ROUTINE"}},{"name":"guidanceAttachmentFile","resource":{"meta":{"profile":["https://fhir.nhs.uk/STU3/StructureDefinition/eRS-DocumentReference-1"]},"resourceType":"DocumentReference","type":{"coding":[{"system":"https://fhir.nhs.uk/STU3/CodeSystem/eRS-AttachmentType-1","code":"GUIDANCE_RESPONSE"}]},"status":"current","indexed":"2026-8-21T15:53:38.335000+00:00","description":"Uploaded file","content":[{"attachment":{"url":"Binary/d0dcc538-2fbd-4a53-93b3-1c654b886fd3"}}]}}]}
but this errors with a 400 code, being a non-specific “bad request”. If I leave out the extra parameter element, the message saves fine.
Either I don’t understand, and files can’t be attached to A&G, only referrals, or I’ve mucked up some thing in the JSON. It formats OK and looks like the example to me !
Any hints ?