The Qboid Cloud API offers a way to interact with data stored in the Qboid Cloud. It allows users to access detailed information about scans and devices, fetch image files, and apply filters for customized queries. Authentication, secured by API tokens generated via Qboid Cloud, ensures data integrity and privacy.
The QBOID APIs can be accessed through this base URL
https://customers.qboid.ai/api/v1
where v1 specifies the current version of the API.
The documentation references customers.qboid.ai as the hostname; please update this to reflect the actual server in use.
The table below provides a summary of the API endpoints. For detailed information, see the specific sections by clicking on the endpoint.
| Endpoint | Description |
|---|---|
/scans |
Retrieves a list of scans, offering optional filtering by barcode, device, and username. Returns scans sorted by timestamp, from the newest to the oldest. |
/scans/{id} |
Retrieves a single scan by its ID. When enabling base64 image encoding, it returns a record in the exact same format as provided by a Perceptor device. |
/images/{path} |
Retrieves an image file from the server. Can return the image as binary data or base64 encoded string. |
/devices |
Retrieves the list of devices associated with the user. Returns a JSON array containing serial numbers of registered devices. |
To access the API, start by creating a token:
Clients must include the API token in one of the following ways:
api_token.Authorization header prefixed with api_token.This command initiates a GET request to the specified endpoint, incorporating the API token within the query parameter for authentication.
Curl
# Replace YOUR_API_TOKEN with your actual API token. curl "https://customers.qboid.ai/api/v1/devices?api_token=YOUR_API_TOKEN"
Python
# Replace YOUR_API_TOKEN with your actual API token. import requests print(requests.get('https://customers.qboid.ai/api/v1/devices?api_token=YOUR_API_TOKEN').text)
This command initiates a GET request to the specified endpoint, incorporating the API token within the Authorization header.
Curl
# Replace YOUR_API_TOKEN with your actual API token. curl -H "Authorization: api_token YOUR_API_TOKEN" "https://customers.qboid.ai/api/v1/devices"
Python
# Replace YOUR_API_TOKEN with your actual API token. import requests headers={'Authorization': 'api_token YOUR_API_TOKEN'} print(requests.get('https://customers.qboid.ai/api/v1/devices', headers=headers).text)
The API rate is limited to 60 requests per minute per API token to ensure equitable access and maintain optimal service performance for all users. Exceeding this limit results in a API Quota Exceeded Error. This measure helps prevent overuse and ensures the system remains reliable and responsive. To resume requests after hitting the limit, please wait a few seconds before retrying.
Note: Qboid is actively monitoring API usage and reserve the right to adjust this limit to adapt to changing usage patterns and maintain system integrity. Additionally, a limit on the number of API tokens per user will be introduced in the future to further ensure fair usage and system stability
When interacting with the API, clients may encounter various errors related to API token authentication and usage. Below is a description of different error types:
Missing Token Error: Indicates that the API token is missing.
{ "error": "APITokenMissing", "message": "API token is missing. Please follow the documentation on how to add the token in your requests" }
Invalid Token Error: Indicates that the API token is invalid.
{ "error": "APITokenInvalid", "message": "Invalid API token" }
Expired Token Error: Indicates that the API token has expired.
{ "error": "APITokenExpired", "message": "API token has expired. Please generate a new API key on your account page" }
Disabled Token Error: Indicates that the API token is not enabled.
{ "error": "APITokenDisabled", "message": "API token is not enabled. You can re-enable it on your account page" }
API Quota Exceeded Error: Indicates that the API token has exceeded its usage limit.
{ "error": "APITokenQuotaExceeded", "message": "API token has exceeded the permissible number of requests. Please wait before making additional requests." }
String fields follow JSON escaping rules: New Line to \n, \ to \\, / to \/, Carriage return to \r, Tab to \t. Images in JSON are base64-encoded Data URI scheme as per RFC-2045, limited to 76 characters per line.
For additional details, please consult the Advanced Encoding Info section in the Qboid Perceptor API specifications.
/scansThis endpoint retrieves a list of scans associated with users in a specific organization. The scans can be filtered by various parameters, including barcode, device, and username. It returns a JSON response containing the scans.
| Parameter | Format | Description |
|---|---|---|
limit |
int (optional) |
Limits the number of scans returned. Defaults to 10 if not provided. Note: Currently, a maximum of 1000 entries is allowed. We plan to introduce pagination support soon. Upon implementing pagination, we intend to significantly lower the maximum limit |
barcode |
string (optional) |
Filters scans by barcode. |
device |
string (optional) |
Filters scans by device serial. |
user |
string (optional) |
Filters scans by username. The username must belong to the same organization as the authenticated user in case he belongs to an organization. This filter is IGNORED for authenticated users who DO NOT belong to any organization. |
after_ts |
int (optional) |
Returns scans uploaded after the specified UNIX timestamp. |
before_ts |
int (optional) |
Returns scans uploaded before the specified UNIX timestamp. |
after_id |
int (optional) |
Returns scans with an ID greater than the specified ID. |
before_id |
int (optional) |
Returns scans with an ID less than the specified ID. |
scans containing the list of scans. Each scan follows the same format as a response from /scans/{id}.GET https://customers.qboid.ai/api/v1/scans?limit=10&barcode=123456&device=FH0402211700000&user=username1
{ "scans": [ { "id": 123, "timestamp": "2024\/01\/01 10:30:00", "ts": 1704105000, "l": 10, "w": 5, "h": 3, "weight": 50, "barcode": "123456", "shape": "Irregular", "device": "FH0402211700000", "note": "Sample note", "attributes": { "hazmat": "true" }, "image": "fullres\/username1\/2024\/01\/01\/image\/88111cf0ed12423b98e4712042170b0e.png", "imageseg": "fullres\/username1\/2024\/01\/01\/imageseg\/88111cf0ed12423b98e4712042170b0e.png", "imagecolor": "fullres\/username1\/2024\/01\/01\/imagecolor\/88111cf0ed12423b98e4712042170b0e.png", "user": "username1" }, ... ] }
/scans/{id}This endpoint retrieves a single scan by its ID. It returns a JSON response containing the scan.
| Parameter | Format | Description |
|---|---|---|
id |
int | ID of the scan to retrieve. |
| Parameter | Format | Description |
|---|---|---|
base64_images |
boolean [0/1] (optional) |
Indicates whether to include base64 encoded images in the response. Defaults to false. |
The message structure for this API endpoint conforms to the standard Dimensioning Record used in our M2 Perceptor API. Below is a brief breakdown of the fields. Refer to the Dimensioning Record to get more details about the fields, escaping characters and image encoding. Fields marked as Optional may be missing on the json in case the scan does not include them.
| Field | Type | Description |
|---|---|---|
| timestamp | String | UTC timestamp indicating when the scan was performed, formatted as yyyy/MM/dd HH:mm:ss. |
| ts | int | UTC UNIX time epoch indicating the time the sequence was uploaded on the server. |
| l | int | Length of the item in mm. |
| w | int | Width of the item in mm. |
| h | int | Height of the item in mm. |
| weight | int (Optional) | Weight of the item in g. |
| barcode | String | Barcode associated with the scan. |
| shape | String | Shape of the item. Can be either Cuboidal or Irregular. |
| device | String | Device serial number. |
| note | String | Additional note about the scan. |
| attributes | map(string->string) {} if empty |
Additional attributes in JSON format. |
| image | String (Optional) | The relative path or base64 encoded image data of the image with the bounding box drawn on top. |
| imagecolor | String (Optional) | The relative path or base64 encoded image data of the image without the bounding box drawn on top. |
| imageseg | String (Optional) | The relative path or base64 encoded image data of the segmented image. |
| user | String | Username associated with the scan. |
Important Note:
In the response, both timestamp and ts fields are returned, but they represent distinct concepts (in addition to differing in format):
timestamp refers to the time when the sequence was acquired (for example, when the upload button is clicked on the M2 device).ts is a UNIX epoch time that indicates when the sequence was actually uploaded to the server.GET https://customers.qboid.ai/api/v1/scans/123?base64_images=1
{ "id": 123, "timestamp": "2024\/02\/26 10:30:00", "ts": 1704105000, "l": 10, "w": 5, "h": 3, "weight": 50, "barcode": "123456", "shape": "Irregular", "device": "FH0402211700000", "note": "Sample note", "attributes": { "hazmat": "true" }, "image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEU...", "user": "username1" }
/images/{path}This endpoint retrieves an image file from the server. It can return the image file as binary data or base64 encoded string depending on the query parameter.
| Parameter | Format | Description |
|---|---|---|
path |
string | The relative path to either image, imageseg, or imagecolor, as defined in Message Structure |
| Parameter | Format | Description |
|---|---|---|
base64 |
boolean [0/1] (optional) |
Indicates whether to return the image as base64 encoded string. Defaults to false. |
GET https://customers.qboid.ai/api/v1/images/path/to/image.jpg?base64=true
The binary or the base64 representation of the requested image
/devicesThis endpoint retrieves the list of devices associated with the user.
GET https://customers.qboid.ai/api/v1/devices
["FH0402211700000", "FH0402211700001", "FH0402211700002"]