What do Core API error codes mean?

John Wade -

Short answer: 401 and 403 are almost always about your token, headers or usage plan. 502 and 504 mean the clinical system didn't answer in time. Find your code below, and send us the trace ID if it doesn't explain what happened.

Code What you see Usual cause What to do
400 Bad Request, or an OperationOutcome From Core Auth: a token or JWKS problem. From the Command API: the submission doesn't match your Questionnaire, for example two answers to an item that allows one. Token: see Why is our token exchange failing? Submission: compare it with the example request we sent you.
401 {"message":"Unauthorized"} The access token is missing or has expired (after 600 seconds), or no practitioner role was found for it. Exchange a new token. Send the practitioner_role_id from the token response in x-fhir-practitionerrole-id, with the header name in lower case.
403 {"message":"Forbidden"} The x-api-key header is missing, or your usage plan doesn't include that API. Requests from outside the UK are also blocked. Send x-api-key on every request. Ask us if you need access to another API.
403 An OperationOutcome containing only an ID That operation isn't available through the Core API, for example GET or POST /Bundle on SystmOne, or reading a Location. For write-back, use the Command API.
404 Not found The resource doesn't exist, or that system doesn't offer the interaction, for example reading a Practitioner by ID where only search is supported. Check the endpoint's /metadata to see what it supports.
410 "Pagination cursor expired or invalid" The page link is no longer valid, often because another search for the same patient ran at the same time. Restart from page 1 without offset or cache-version. See How do paging, empty results and dates work when reading records?
413 {"message":"Request Too Long"} The request is too large, usually an attachment over 3 MB. Keep attachments to 3 MB.
429 Too Many Requests You're over your usage plan's rate or monthly quota. Wait, then retry. Contact us to review your current plan if required. See How do usage plans, rate limits and response times work?
500 Internal server error Something failed on our side. Send us the trace ID and we will investigate
502 or 504 Bad Gateway or Gateway Timeout The clinical system didn't respond in time: a busy SystmOne practice, a large record, or the practice's gateway being offline. Don't retry straight away. A second request queues behind the first. Wait, confirm the event did not complete, then retry once.

 

If the table above doesn't cover it, please send us:

  • The X-Amzn-Trace-Id or x-amzn-requestid from the response (how to find it)
  • The request method and URL, without your token or API key
  • The time of the request (UTC) and your client ID
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk