Common API Topics

Common API topics for all endpoints.

Authentication

Authentication to the Bold Metrics API is performed by submitting your ID and API key in the query parameters:

  • client_id: <ID>

  • user_key: <API_key>

Both these values will be provided by Bold Metrics. All API requests must be made via HTTPS. Please keep this API key private, as charges may be based on calls using this key.

Error Object

As the API goes through the request, specific errors are returned and appended sequentially inside of the 400 error.

JSON examples of each error:

{
  "code": 400,
  "message": {
    "overall": "Validation errors",
    "specifics": [
      {
        "field": "height",
        "message": "Missing data for required field."
      }
    ]
  }
}

{
  "message": {
    "code": 400,
    "overall": "Validation errors",
    "specifics": [
      {
        "field": "jean_waist",
        "message": "waist_circum_preferred is greater than maximum value 67.01."
      },
      {
        "field": "height",
        "message": "height is greater than maximum value 85.94."
      }
    ]
  }
}

All errors are returned as JSON objects. However, it's possible an internal server error could occur that will cause the API to return HTML instead of JSON.

If the API is abruptly shot down by a bug or error, our server will return an HTML 500 error, such as the following:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2 Final//EN”>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your
request. Either the server is overloaded or there is an error in the application.</p>

Outlier Detection

Outlier Detection will outline any issues with the customer's inputs. These could be either inputs that are out of bounds or simply unlikely combinations, such as a weight of 300 lbs. and a waist measurement of 28".

An outlier error will look something like the following. A outlier_status flag set to true and a outlier_messages object specifying which body measurements are inconsistent with one another.

"outlier": true,
"outlier_messages": {
  "overall": "Confidence errors",
  "specifics": [
    {
      "field": "",
      "message": "\"hip_circum\" is inconsistent with \"sleeve_inseam\"."
    },
    {
      "field": "",
      "message": "\"jean_inseam\" is inconsistent with \"sleeve_inseam\"."
    },
  ]
},

The API will still predict the body dimensions as there are times when the body is only a slight outlier, allowing the ability to check inputs to confirm if the customer is indeed an outlier.

Rate Limiting

Rate limiting for the API is based on the number of requests that have been negotiated in your agreement. To increase the number of available requests, please email concierge@boldmetrics.com. The current global policy is 25 request per second.

Last updated