Errors

Errors from the QC Analytical Results API: the error body, every code and its status, the rate limit, and how to report a problem.

An error is an HTTP status of 400 or more with this body:

{
  "error": {
    "code": "missing_parameter",
    "message": "analyte is required.",
    "details": {"parameter": "analyte"},
    "request_id": "req_7f3a9c2e1b"
  }
}

Codes

Status Code When Details
401 missing_key No Authorization header
401 invalid_key The key isn’t known, or was revoked
403 scope The key is real but isn’t for the charts service
402 allowance_reached Your account is set to stop at its plan’s allowance, and this month’s chart calls are used. Calls start again on the 1st of next month, or at once if you turn the stop off or move to a larger plan. Retrying won’t help before then allowance, chart_calls, resets_on
400 invalid_json The body isn’t JSON
400 invalid_gzip Content-Encoding: gzip but the body isn’t gzip
400 no_rows A dataset with no rows
400 invalid_parameter A value of the wrong type, outside its range or not one of the allowed values; or an unknown kind parameter, and the allowed values or min/max
400 missing_parameter A required parameter is missing (stage when facet_by_stage is off, for a chart that needs it) parameter; for stage, the dataset’s stages
400 unknown_parameter A parameter the chart doesn’t take unknown, and the chart’s parameters
404 unknown_chart No chart of that name charts
410 dataset_expired The dataset is gone (an hour unused, dropped to make room, deleted, or never yours): send it again
413 too_large The request is over 50 MB
413 too_many_rows Over 500,000 rows in a dataset, or over 1,000,000 across yours
422 missing_columns A required column is missing missing, required
422 wrong_dataset_kind A precision chart of an accuracy dataset, or the other way round
422 no_dates A date range asked of a dataset with no dates in that column: use despatches
422 no_results Nothing in the dataset matches the lab, analyte, stage or CRM and dates
422 crm_not_found The CRM has no results for this analyte with these filters
422 insufficient_data Too few results for this chart (the app’s own message, e.g. a chart needing more than one despatch) app_message, and the app’s pop-up alert
429 rate_limited More than 300 calls in a minute from this key: wait a moment
500 internal_error Something went wrong on our side: email the request id
503 busy The service is holding as much data as it can just now: try again in a minute
503 keys_unavailable The key store couldn’t be reached: try again shortly

A warnings list in a successful chart is not an error: it is what the app would have shown beside the chart (for instance, that a control limit could not be computed).

Reporting a problem

Email [email protected] with:

  1. the request_id (or the X-Request-Id header) of a call that went wrong;
  2. the chart and parameters you sent (never the key);
  3. if the answer looks wrong rather than failing, the rows for that lab and analyte, or a chart from the app for comparison.

We keep the log of every call (what was asked, status, time: no data) for a while, so a request id lets us find it without you sending anything else.