Failed to resolve API Key variable request.header.apikey

I’m trying to connect to Organisation Data Terminology - FHIR API in the Integration (INT) environment.

get the following error

{
“resourceType”: “OperationOutcome”,
“issue”: [
{
“severity”: “error”,
“code”: “401”,
“details”: {
“coding”: [
{
“code”: “401”,
“display”: “Unauthorized”
}
]
},
“diagnostics”: “{“fault”:{“faultstring”:“Failed to resolve API Key variable request.header.apikey”,“detail”:{“errorcode”:“steps.oauth.v2.FailedToResolveAPIKey”}}}”
}
]
}

I can already connect to the eRS API’s on int.api.service.nhs.uk/referrals/FHIR/STU3/ so I know my Java Web Token processes work.

I have added the API to my App( Not sure why it has a different environment name to the others.

image

I have also tried by creating a specific App for it but nether works.

Any guidance appreciated

Hi Alan,

The organisation-data-terminology API uses API key authentication for access to the Integration and Production environments.

Your API key is available within the ‘Environment Access’ tab of the Developer Portal - select the application / product name, and then ‘Edit’ against ‘Active API Keys’. (You’ll need to create an application / product in the ‘Environment Access’ tab if you have not already done so.)

Note that your API key for an application / product registered to the Integration environment is automatically enabled for access. Your API key for the Production environment is not enabled until a Digital Onboarding Assessment has been submitted and approved.

Kind regards,

Sophie

Hi Sophie

I have the API Key and that API Key returns a token. The problem I have is that that token is successful when I use it to retrieve data from the ePR API but it fails if I use it to retrieve data from the organisation-data-terminology-api.

Both these API’s have been added to my application GHT-ERS-Integration- e-Referral Service, JWT(6fc897fa-e7d5-4894-a0ea-5f45b722d83a) so I am presuming that should either both work or both fail.

Regards

Alan

Worked it out

ers connects with Application-restricted RESTful API - signed JWT authentication
organisation-data-terminology-api connects with Application-restricted RESTful APIs - API key authentication