Skip to content

Backend API

INFO

The use of the backend API is not recommended. Consider using the Programmatic API first.

The base API URL is https://api.fibbl.com

Endpoints

  • /check-model-availability - can be used to check whether a model is available or not. The components do this check and hide themselves, if the model isn't available (no model for a certain product id), so in most cases you don't have to check model availability manually.
    • method GET (HEAD isn't supported)
    • query params:
      • product-id - the same id that is passed as data-product-id to the components
      • access-token - the token that can be found on the Fibbl Client Portal (the same token that can be used in the global component config for local development); on the backend the token is always required ( both in dev and prod)
    • Return statuses and values:
      • 200 with an empty body, if the model is available
      • 400 with an empty body, if the model is not available
      • 4** or 5** with an error message (plain text) in case of error
    • Node.js example:
    js
    const apiUrl = 'https://api.fibbl.com/check-model-availability';
    const response = await fetch(`${apiUrl}?product-id=123&access-token=xxxxxx`);
    if (response.status === 200) {
        console.info('Model is available');  
    } else {
        const errorMessage = await response.text(); // read body as text
        console.error(`Model is not available. Status: ${response.status}. Message: ${errorMessage}`);
    }