Crownpeak
  • Product Discovery Developer Guide
  • 🛒Item catalog management
    • What is the Items API?
    • How to work with Items
      • Item Schema
        • Attributes
        • Nested Item Schemas
        • Using the Item Schema API
        • DefaultLocale API
        • Onboarding on/migrating to Fredhopper
        • List of Reserved Attributes
      • Category Tree
        • Using the Category Tree API
        • Onboarding on XO
      • Item Catalog
        • Using the Catalog API
      • Items
        • Using the streaming Items API
        • Using the batch Items API
    • Step by Step guide
      • Step by step guide for Fredhopper customers
    • Feedback
      • Using the Feedback API
    • Authorization to APIs
    • Troubleshooting API errors
  • 🎯XO Recommendations
    • Introduction
    • Using the Recommendations API
    • Setting up the Chrome extension
    • Micro-segmentation
    • XO Legacy APIs
  • 🔎XO Search
    • Introduction
    • Getting started
    • API Reference
      • Search API
      • Autocomplete API (Beta)
      • Product Suggest API
    • API Parameters
      • Search
      • Pagination
      • Faceting
      • Sorting
      • Grouping
      • Filtering
      • Disable features
      • Response mask
      • Context
    • Configuration limitation
  • 🧪A/B testing
    • Fredhopper A/B testing
      • Integration steps for a non-caching solution
      • Integration steps for a caching solution
        • Java SDK Integration
          • Setup
          • Retrieve running A/B tests - Java SDK
          • Filter and request variant - Java SDK
          • Extending the SDK
        • Manual A/B tests integration
          • Retrieve running A/B tests
          • Filter out irrelevant A/B tests
          • Assign variants to user
          • Request variant for page
        • Limitations and Best Practices
  • 📚Resources
    • Glossary
    • Best Practices
      • Tracker Best Practices
      • Items API Best Practices
      • Fredhopper Data Configuration Best Practices
      • Fredhopper Query Response Best Practices
      • Fredhopper Merchandising Studio Best Practices
    • Privacy Notice
  • Archived Pages
    • FHR Tracking plan
    • XO Tracking plan
    • The Tracking API and JS Library
      • What to Track
        • Generic Actions
          • View
          • Click
          • Add to Cart
          • Remove from Cart
          • Purchase
        • Custom Actions
      • Initializing the JavaScript Library
      • REST API Technical Documentation
Powered by GitBook
On this page
  1. Item catalog management

Troubleshooting API errors

PreviousAuthorization to APIsNextIntroduction

Last updated 1 year ago

Each API has error codes corresponding to prerequisites. But some errors can appear in specific cases, and some errors are common to the different endpoints.

400 Bad Request

Something is wrong with your request (e.g. required attribute is missing). Check the response body for more information.

401 Unauthorized

This error appears in case the call is not correctly authenticated. Refresh the access token and retry the call. See

403 Forbidden

If you are authenticated, this error appears in case you do not have the sufficient permissions. Fix service account roles and retry. See

429 Too Many Requests

You are being rate limited. Check the Retry-After HTTP header to know when the call can be retried. However if this happen there is likely something wrong with your implementation, for instance make sure to reuse access tokens until they expire before requesting a new one.

500 Internal Server Error / 502 Bad Gateway / 503 Service Unavailable / 504 Gateway Timeout

In some cases with a correct request, the API may return one of these errors. As long as this is limited to a very small percentage of requests over a short period of time this is considered normal. As an example it is considered normal to have on occasion a 30 minute period with error rate under 1% of the sent traffic.

This usually occurs when the API is scaling up in case of a high volume of requests. This error indicates that the API is in preparation.

A general best practice for sending data over the internet is to set up a retry and/or back-off system in case of 500/502/503/504 errors.

A good starting point on the topic can be this article

Timeouts

Connection timeouts and read-timeouts may occur occasionally. They are usually caused by network latency and are thus out of our control. Retry strategies are also the best way to deal with those errors. It is hard to advise on specific timeout values because they depends on the network latency between clients and servers. Try it out and choose what best fit your needs !

Error body example

{
    "code": {{Error number}},
    "message": {{Error message}},
    "details": []
}

The error number is specific to our API. The Error message contains additional information about the error encountered. It can also contain an error category specific to each API.

🛒
Authorization to APIs
Authorization to APIs
https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/