FHIR GPConnect Access HTML Help with Errors

I’m just in the initial phase of querying GPConnect Access Record HTML for integration into our systems, and I’m falling at the first hurdle.

I’ve looked though whatever documentation I can find (almost all of it seems to be outdated by many years), and I’ve cobbled something together, but I get errors back.

I have the following code (C#):
I’m using the Hl7.Fhir.R4 package from Firely which seems to be the recommended package for accessing the NHS FHIR APIs.

string nhsID = "9658218873";
HttpClient http = new();

var TraceID = Guid.NewGuid().ToString();

http.DefaultRequestHeaders.Add("Ssp-From", "200000000359");
http.DefaultRequestHeaders.Add("Ssp-To", "918999198993");
http.DefaultRequestHeaders.Add("Ssp-InteractionID", "urn:nhs:names:services:gpconnect:fhir:operation:gpc.getcarerecord");
http.DefaultRequestHeaders.Add("Ssp-TraceID", TraceID);

var client = new FhirClient(baseURL, http);
client.Settings = new FhirClientSettings { PreferredFormat = ResourceFormat.Json };
var parameters = new Parameters();
parameters.Add("patientNHSNumber", new Identifier("http://fhir.nhs.net/Id/nhs-number", nhsID));
parameters.Add("recordSection", new CodeableConcept("http://fhir.nhs.net/ValueSet/gpconnect-record-section-1", "SUM"));
var json = JsonConvert.SerializeObject(parameters);
var resource = await client.TypeOperationAsync<Patient>("gpc.getcarerecord", parameters);

I’ve got the various values from the samples found in the Postman scripts, and they work within Postman.

When I run that code I get the following exception back:

Operation was unsuccessful because of a client error (UnsupportedMediaType). OperationOutcome: Overall result: FAILURE (1 errors and 0 warnings) [ERROR] (no details)(further diagnostics: Unsupported content media type)

I’m tearing my hair out trying to figure out where I’m going wrong. I’ve been trying to read through the documentation, but it’s a complete rats nest of documents and so many dead end links that it’s almost impossible to extract any useful guidance.

Please, if anyone can help out I’d be very thankful.

Hi Paul - we have a dedicated onboarding process for GP Connect API’s. The first stage would be to submit a use-case and have this approved, following this we would book an intro call in with yourself to go over the development resources available as well as walk you through the steps for our different gates of assurance (as we have different environments for testing). The answer to all of your queries would then become clear following this call. In order to kick this process of please submit a use-case form here: https://digital.nhs.uk/services/gp-connect/direct-care-apis-use-case-submission-form . One of our team will then be in touch. Many Thanks - Harry.

Hi Harry. We’re already doing that. In fact I was on a VC with you week before last with my boss Mike.

Hi Paul - apologies, names aren’t my forte! If you email me with the full API request you’re firing through then I can take a look for you. Cheers