NAV
shell

Introduction

This is the API documentation for the API of https://app.maddox.ai

This API allows customers to interact and work with the data provided by the edge inference devices.

Placeholder

This documentation uses the following placeholders:

Headers

If not stated otherwise, the following headers must always be set when sending HTTP requests:

Inferences

The inferences route is used to export the quality control results as inferred by the MaddoxAI models on your productions lines.

Get inferences

curl -v -X GET 'https://api.maddox.ai/inferences/<project>?classes=SCRATCHED&count=1&offset=0' \ 
-H 'Accept: application/vnd.maddox.v1+json' \ 
-H 'Authorization: Bearer <access-token>'

result:

< HTTP/1.0 200 OK
< Content-Type: application/vnd.maddox.v1+json

{
  "data": [
    {
      "createdAt": "2021-06-09T12:52:47Z",
      "data": "https://maddoxaistorage.azure.microsoft.com/.../192303729431678976.jpg",
      "meta": {
        "productType": "semiconductor_ABC123",
        "serialNumber": "E123456",
        "productionLine": {
          "alias": "production_line_567_alias",
          "id": "production_line_567",
        }
      },
      "inferences": [
        {
          "label": "SCRATCHED",
          "probability": 0.99,
          "coordinates": [
            {
              "x": 519.8424574056194,
              "y": 306.14330887831534
            },
            {
              "x": 639.588715444605,
              "y": 306.14330887831534
            },
            {
              "x": 639.588715444605,
              "y": 379.8946092712532
            },
            {
              "x": 519.8424574056194,
              "y": 379.8946092712532
            }
          ]
        }
      ]
    }
  ]
}

Use GET https://api.maddox.ai/inferences/<project> to get inferences for images

Parameter Description
count <positive int> - number of items to return
offset <positive int> - number of items to skip
classes <comma-separated-list> - the name of the classes to filter for, separated by ,
orderBy OLDEST_FIRSTNEWEST_FIRSTLOWEST_PROBABILITY_FIRSTHIGHEST_PROBABILITY_FIRST - how to sort the result.
timeframe <positive int><m|h|d> or <timestamp-from>-<timestamp-to> - defines the time-frame for the data to be exported
Examples:
7d uses the data of the last 7 days
5m uses the data of the last 5 minutes
12h uses the data of the last 12 hours
1626157266-1626243666 for a specific timeframe, stated in UNIX timestamps
2021-07-13T06:21:06Z-2021-07-14T06:21:06Z for a specific timeframe, stated in RFC3339 datetime format
productTypes <comma-separated-list> - the name of the product types to filter for, separated by ,
serialNumbers <comma-separated-list> - the name of the serial numbers to filter for, separated by ,
productionLines <comma-separated-list> - the production lines (ids and/or aliases) to filter for, separated by ,

Errors

The API uses the following error codes:

Error Code Meaning
400 Bad Request. Your request is invalid.
{"msg": "'<invalid-argument>' is no valid argument. Use one of <valid-arguments-list>."}
401 Unauthorized. Your credentials are invalid.
{"msg": "Missing Authorization Header"}
403 Forbidden. You are not authorized to use this resource.
404 Not Found. The resource does not exist.
415 Unsupported Media Type. Invalid accept header.
422 Unprocessable Entity. Could not process the JWT.
{"msg": "Bad Authorization header. Expected value 'Bearer <JWT>'"}
500 Internal Server Error. An unexpected error occured.