Skip to main content

Errors

Image-Charts uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • 2xx success status codes confirm that your request generated a chart
  • 4xx error status codes indicate an error because of the information provided (e.g., a required parameter was omitted or specified with an unsupported format, etc.).
  • 5xx error status codes are rare and indicate an error with Image-Charts's servers

Error HTTP responses can also contains error codes, some of them can be retried.

HTTP Status Code

  • 200 OK - The chart was generated as expected.
  • 400 Bad Request - The request was unacceptable, often due to missing required parameter or malformed one. Check error code and error details for more information.
  • 401 Unauthorized - No valid API key provided.
  • 403 Forbidden - The API key doesn't have permissions to perform the request.
  • 429 Too Many Requests - The request reach the limits, see error retries.
  • 500 Server Errors - Something went wrong on Image-Charts's end. (These are very rare.)
  • 502 Bad Gateway - Something went wrong on Image-Charts's end (rare case), see error retries.

Error codes

Some 4xx errors that could be handled programmatically (e.g., a parameter is malformed) include an error code in the x-ic-error-code HTTP header response parameter. Below is a list of possible error codes that can be returned, along with additional information about how to resolve them. Regarding the error code an additional x-ic-error-validation http header parameter with further details is also sometimes included.

  • IC_INVALID_SIGNATURE: Invalid signature. Please check our documentation and code examples
  • IC_ACCOUNT_ID_NOT_FOUND: ACCOUNT_ID not found, you must be an Image-Charts subscriber
  • IC_MISSING_ENT_PARAMETER: The icac (ACCOUNT_ID) and ichm (HMAC-SHA256 request signature) query parameters must both be defined if specified. Learn more
  • IC_RETINA_ERROR: The retina (high resolution image) feature is only available on Enterprise+ subscriptions. Please go to Image-Charts website to subscribe or contact our support to upgrade your subscription.
  • IC_LOCALE_ERROR: Language localization feature is only available on Enterprise+ subscriptions. Contact our support to upgrade your account. Read more on our documentation
  • IC_CHARTJS_RENDERING_ERROR: Image-Charts could not render Chart.js chart
  • IC_UNAUTHORIZED_FONT_STYLE_ERROR: Font-style feature is only available on Enterprise+ subscriptions
  • IC_UNAUTHORIZED_FONT_FAMILY_ERROR: Font-family feature is only available on Enterprise+ subscriptions
  • IC_UNAUTHORIZED_STYLE_TITLE_ERROR: Stylize title with font-family and/or font-style is only available on Enterprise+ subscriptions
  • IC_UNAUTHORIZED_MULTI_AXIS_ERROR: Simple axis (chxt=x,y) are free forever. Multiple axis feature (chxt=x,x,y,y,t,t,r,r) is only available for Enterprise+ subscriptions
  • IC_UNAUTHORIZED_COMPOUND_CHART_ERROR: Compound charts (line markers) feature is only available on Enterprise+ subscriptions
  • IC_UNAUTHORIZED_BACKGROUND_IMAGE_CHART_ERROR: Background images are only available on Enterprise and Enterprise+ subscriptions
  • IS_VALIDATION_ERROR: There is one or more request parameters that are malformed. Check the associated x-ic-error-validation response http header for details.
  • IC_GRAPHVIZ_INVALID_SYNTAX: The GraphViz chart could not be generated because of invalid syntax. Check that the chl request parameter is valid.
  • IC_GRAPHVIZ_ERROR: The GraphViz chart could not be generated due to internal GraphViz error.
  • IC_GRAPHVIZ_MAX_EDGES_REACHED: The requested Graph has reached the maximum allowed number of edges (400). See GraphViz known limitations for more details.
  • IC_GRAPHVIZ_MAX_NODES_REACHED: The requested Graph has reached the maximum allowed number of nodes (200). See GraphViz known limitations for more details.
  • IC_QRCODE_TOO_MUCH_DATA: QRCode maximum data size exceeded
  • IC_BAD_JSON_ERROR: Value passed in query parameter chart (or c') must be a json, ES5 json or a base64 encoded json
  • IC_BAD_BACKGROUND_COLOR_ERROR: Background color must be a valid rgba, rgb, hex or text color
  • IC_BAD_BACKGROUND_IMAGE_MAX_SIZE_REACHED_ERROR: Background image size is too big. It should not exceed 1048576 bytes
  • IC_BAD_BACKGROUND_IMAGE_MAX_REDIRECTS_REACHED_ERROR: Could not download the image, max request redirects limit (2) reached
  • IC_BAD_BACKGROUND_IMAGE_MAX_TIMEOUT_REACHED_ERROR: Could not download the image, the request timeout is reached (2500ms)
  • IC_BAD_BACKGROUND_IMAGE_COULD_BE_DOWNLOADED_ERROR: Could not download the image, an error related to DNS or Network occurred
  • IC_BAD_DATA_FORMAT: .data attribute must contain a "datasets" attribute with a "data" array inside it. For instance:
      type: 'bar',
    data: {
    datasets: [{
    data: [10, 20, 30, 40]
    }]
    }
    }```

  • IC_EMAIL_NOT_SENT: Could not send email
  • IC_SEND_EMAIL_MISSING: email attribute missing, could not sent email
  • IC_CONTACT_NOT_UPDATED: Could not update contact
  • IC_METADATA_EMAIL_MISSING: email attribute missing, could not create or update metadata
  • IC_UPDATE_METADATA_FAILED: Could not create or update Metadata
  • IC_CUSTOMER_SEARCH_FAILED: Customer search failed
  • IC_DATA_LOADING_FAILED: Data loading failed

Error handling

Your Image-Charts integration might have to deal with errors at some point when making requests to the Image-Charts API. These errors fall into three major categories:

Content Errors

Content errors are the result of the contents of an API request being invalid and return an HTTP response with a 4xx error code. For example, the API servers might return a 401 if an invalid account_id or signature was provided, or a 400 if a required parameter was missing. Integrations should correct the original request, and try again. Depending on the type of user error (e.g., a malformed data parameter), it may be possible to handle the problem programmatically. In these cases, include a code field to help an integration react appropriately. See error codes for more details.

Network Errors

Network errors are the result of connectivity problems between client and server and return low-level errors like socket or timeout exceptions. For example, a client might time out while trying to read from Image-Charts's servers, or an API response might never be received because a connection terminates prematurely. A network error wouldn't necessarily have otherwise been a successful request--it can also be another type of error that's been cloaked by an intermittent problem.

This class of errors is where the value of request retries is most obvious. When intermittent problems occur, clients are usually left in a state where they don't know whether or not the server received the request. To get a definitive answer, they should retry such requests with the same parameters until they're able to receive a result from the server.

Most client libraries can generate retry requests automatically, but need to be configured to do so. They perform their first retry quickly after the first failure, and subsequent retries on an exponential backoff schedule (see error retries for more details), the assumption being that a single failure is often a random occurrence, but a pattern of repeated failures likely represents a chronic problem.

Server Errors

Server errors are the result of a problem with Image-Charts's servers and return an HTTP response with a 5xx error code. These errors are the most difficult to handle and we work to make them as rare as possible but integrations should be able to handle them when they do arise.

You should treat the result of a 500 request as indeterminate. The most likely time to observe one is during a production incident, and generally during such an incident's remediation. Image-Charts engineers will examine failed requests that result in 500s and fix them.

Error retries

Clients may retry on network errors, 429 and 502 http status code errors with exponential backoff. The minimum delay should be 1s.

When a client retry calls without waiting, it can produce a heavy load on the Image-Charts servers. Image-Charts infrastructure automatically limits IP that generate excessive load.

To avoid triggering these limits, you are strongly encouraged to implement truncated exponential backoff with introduced jitter.

Truncated exponential backoff is a standard error-handling strategy for network applications. In this approach, a client periodically retries a failed request with increasing delays between requests. Clients should use truncated exponential backoff for all requests to Image-Charts that return HTTP 502 and 429 response codes.