Error Accept Header is invalid.

495 views
Skip to first unread message

Jamtech App

unread,
May 11, 2022, 4:17:40 AM5/11/22
to Cerner FHIR Developers
Hello Cerner Team,

I'm getting this error when trying to call this api :-  https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Binary/:id
Requested hearder is :- 
Accept: application/json
Authorization: <OAuth2 Bearer Token>
  1. issue: [{severity: "error", code: "invalid",…}]
    1. 0: {severity: "error", code: "invalid",…}
      1. code: "invalid"
      2. diagnostics: "The Accept Header is invalid. See the documentation on the fhir.cerner.com website for acceptable format values for the resource you are attempting to access."
      3. expression: ["http.Accept"]
      4. severity: "error"
  2. resourceType: "OperationOutcome"
Please let me know if i did any mistake.

Thanks
Jamtech App

Jamtech App

unread,
May 16, 2022, 7:19:27 AM5/16/22
to Cerner FHIR Developers
I am getting different error message.This time i have set the Accept : application/fhir+json in the header
Response :- 
{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "forbidden",
            "details": {
                "text": "Forbidden resource"
            },
            "expression": [
                "http.Authorization"
            ]
        }
    ]
}

Here is my authentication response :- 
{
   "access_token":"token",
   "scope":"system/Patient.read system/Binary.read system/DocumentReference.read system/DocumentReference.write",
   "token_type":"Bearer",
   "expires_in":570
}



Thanks
Jamtech App

Fenil Desani (Cerner)

unread,
May 16, 2022, 2:49:08 PM5/16/22
to Cerner FHIR Developers
Hello,

DocumentReference.content.attachment.contentType should be used to set the Accept header. An Accept header of application/fhir+json could be supplied instead, if the JSON Binary resource is desired instead of the raw data.
This resource will not accept the application/json mime type unless the underlying binary data is json.

Please provide X-request-id from the response header to troubleshoot further.

Thanks,
Fenil

Jamtech App

unread,
May 20, 2022, 9:12:56 AM5/20/22
to Cerner FHIR Developers
Thanks Fenil,

[x-request-id] => a39d518b-a12f-4878-8ace-192f72a58882+1456
This x-request-id is from response header when i get  "text": "Forbidden resource" error.

I have some query could you please help me out

>> Could you tell me that is Encounter id is necessary for creating DocumentReference?  ( I have checked the documentation but the encounter id is not mandatory )
I am asking this because when i create a DocumentReference with Encounter Id then this URL :-    https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Binary/:id is working fine.

But without Encounter Id it raises error.
Response :- 
{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "forbidden",
            "details": {
                "text": "Forbidden resource"
            },
            "expression": [
                "http.Authorization"
            ]
        }
    ]
}


>> What if the patient does not the have the any Encounter list then should we need to create encounter of that patient?

>> Also how to shift this in production environment means :-
       ---- what is the base url. ?
       ---- From where i get the {{tenant_id}} or is it same which i used right now ?


Thanks,
Jamtech App

Reply all
Reply to author
Forward
0 new messages