### Get device data keys - example response Source: https://docs.qubitro.com/developers/device-data Example response for the get device data keys endpoint. Returns an array of field names from the most recent data point. ```json ["temperature", "humidity", "battery_level", "rssi", "snr", "timestamp"] ``` -------------------------------- ### GET devices from dashboard - 200 response Source: https://docs.qubitro.com/developers/dashboards Example 200 response for the GET devices endpoint. Contains a list of devices with device_id, device_name, project_id, and project_name. ```JSON { "action": "get blob list", "data": { "devices": [ { "device_id": "text", "device_name": "text", "project_id": "text", "project_name": "text" } ] }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### POST /v2/projects/{project_id}/devices - HTTP request example Source: https://docs.qubitro.com/developers/devices Example HTTP request to create a device. The body includes all required and optional fields, with 'source' set to 'mqtt'. The Authorization header must use the Bearer prefix with your API key. ```http POST /v2/projects/{project_id}/devices HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 424 { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] } ``` -------------------------------- ### GET /v2/projects/{project_id}/devices - 200 response Source: https://docs.qubitro.com/developers/devices Example JSON response for a successful device list request. The data array contains device objects with fields like id, name, metadata, and tags. Device credentials are excluded in list view. ```json { "action": "get blob list", "data": [ { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] } ], "message": "", "status": 200, "success": true } ``` -------------------------------- ### Success Response for Delete Device Source: https://docs.qubitro.com/developers/devices Example response indicating the device was deleted successfully. ```json { "success": true, "message": "Device deleted successfully", "action": "delete device" } ``` -------------------------------- ### Create a new project - 200 response Source: https://docs.qubitro.com/developers/projects Example JSON response for a successful project creation. Returns the created project object with generated ID. ```JSON { "action": "get blob list", "data": { "created_at": "2024-01-15T10:30:00Z", "description": "Production environment IoT devices", "id": "3e5c0246-c759-48e8-8345-27db13f11ff7", "name": "Production IoT Fleet", "tags": [ "production", "fleet", "monitoring" ] }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### List device files with GET /v2/projects/{project_id}/files Source: https://docs.qubitro.com/developers/device-communication Lists device files for a project. The `type` query parameter is required and must be 'firmware' or 'logo'. Replace `YOUR_API_KEY` with your actual API key using the Bearer prefix. ```HTTP GET /v2/projects/{project_id}/files?type=text HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Accept: */* ``` -------------------------------- ### GET function details response Source: https://docs.qubitro.com/developers/functions Example JSON response for a successful function retrieval. Includes configuration fields such as conditions, metadata, and status. ```json { "action": "get blob list", "data": { "avatar": "text", "brand": "text", "conditionType": "text", "conditions": [ { "key": "temperature", "operator": ">", "value": "30" } ], "created": "text", "cron_properties": { "cron_expression": "text", "timezone": "text" }, "debounce_period": 1, "description": "text", "device_id": "text", "enabled": true, "from_template": true, "function_type": "text", "id": "text", "interpreter": "text", "jsonata": "text", "last_triggered": "text", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "text", "name": "text", "project_id": "text", "reason": "text", "rule_type": "text", "scheduled_type": "text", "script": "text", "source_type": "text", "status": "text", "storage_type": "text", "template_update": true, "transformation_id": "text" }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### GET function details request Source: https://docs.qubitro.com/developers/functions Example HTTP request to retrieve function details. Requires the type query parameter (e.g., decoder) and Bearer authorization. ```http GET /v2/projects/{project_id}/devices/{device_id}/functions/{function_id}?type=decoder HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Accept: */* ``` -------------------------------- ### List projects of a group - 200 response Source: https://docs.qubitro.com/developers/organization Example successful response returning an array of project objects with details like id, name, description, and tags. ```json { "action": "get blob list", "data": [ { "created_at": "2024-01-15T10:30:00Z", "description": "Production environment IoT devices", "id": "3e5c0246-c759-48e8-8345-27db13f11ff7", "name": "Production IoT Fleet", "tags": [ "production", "fleet", "monitoring" ] } ], "message": "", "status": 200, "success": true } ``` -------------------------------- ### List organization groups - 200 response Source: https://docs.qubitro.com/developers/organization Example successful response returning an array of groups with IDs and names. The 'action' field shows 'get blob list'. ```json { "action": "get blob list", "data": { "groups": [ { "id": "5f8d0d55b54764ca6f3a1234", "name": "Engineering Team" } ] }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### POST /v2/projects/{project_id}/devices Source: https://docs.qubitro.com/developers/devices Creates a new device in the specified project and generates connection credentials automatically. The response includes MQTT credentials or HTTP token based on the selected protocol. ```APIDOC ## POST /v2/projects/{project_id}/devices ### Description Creates a new device in the specified project and generates connection credentials automatically. The response includes MQTT credentials or HTTP token based on the selected protocol. ### Method POST ### Endpoint /v2/projects/{project_id}/devices ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID (UUID format). Example: `3e5c0246-c759-48e8-8345-27db13f11ff7` #### Request Body - **avatar** (string) - Optional - Device avatar/icon URL. Example: `https://cdn.qubitro.com/avatars/temperature-sensor.png` - **brand** (string) - Optional - Device brand (defaults to "Custom"). Example: `Custom` - **description** (string) - Optional - Device description (required, max 500 characters). Example: `Temperature sensor in warehouse zone A` - **device_credentials** (object) - Optional - MQTT credentials (username, password) or HTTP token. - **id** (string) - Optional - Unique device identifier. Example: `5f8d0d55b54764ca6f3a1234` - **last_seen** (string) - Optional - Last time device sent data (ISO 8601 format, UTC). Example: `2024-01-15T14:30:00Z` - **metadata** (object) - Optional - Custom metadata key-value pairs for filtering and organization (e.g. location, floor, zone). - **model** (string) - Optional - Device model (defaults to "Custom"). Example: `Custom` - **name** (string) - Optional - Device name (required, max 100 characters). Example: `Temperature Sensor 01` - **source** (string) - Optional - Connection protocol: "mqtt", "http", or "intemo-wifi" (required for creation). Example: `mqtt` - **tags** (string[]) - Optional - Optional tags for categorization (alphanumeric and underscore only). Example: `["warehouse","zone_a","temperature"]` ### Request Example ``` POST /v2/projects/{project_id}/devices HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 424 { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] } ``` ### Response #### Success Response (200) - **action** (string) - Optional - Action that was performed. Example: `get blob list` - **data** (object) - Optional - Device item. - **message** (string) - Optional - Human-readable message (often empty on success). - **status** (integer) - Optional - HTTP status code. Example: `200` - **success** (boolean) - Optional - Operation completed successfully. Example: `true` #### Response Example ``` { "action": "get blob list", "data": { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] }, "message": "", "status": 200, "success": true } ``` #### Error Responses - **400** - Invalid request body - Check required fields and format. - **401** - Unauthorized - Invalid or missing API key. - **404** - Project not found. ``` -------------------------------- ### HTTP Request for Aggregated View Source: https://docs.qubitro.com/developers/aggregated-data Example HTTP GET request to the aggregated-view endpoint with query parameters for pagination and range. Replace placeholders with actual project, device, and aggregation IDs. ```http GET /v2/projects/{project_id}/devices/{device_id}/aggregated-view/{contaggr_id}?page=1&limit=1&range=text HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Accept: */* ``` -------------------------------- ### Successful response listing device files Source: https://docs.qubitro.com/developers/device-communication Example 200 response for listing device files. The response contains an array of file objects with name, description, size, and time fields. ```json { "action": "get blob list", "data": { "files": [ { "description": "Production firmware", "name": "firmware_v2.1.0.bin", "size": 524288, "time": "2024-01-15T10:30:00Z" } ] }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### GET /v2/projects/{project_id}/devices/{device_id}/data - HTTP Request Source: https://docs.qubitro.com/developers/device-data Example HTTP request to retrieve device data. Uses the Bearer authentication scheme with the API key. The query parameters include page, limit, and range. ```http GET /v2/projects/{project_id}/devices/{device_id}/data?page=1&limit=1&range=text HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Accept: */* ``` -------------------------------- ### Send configuration and firmware commands to device Source: https://docs.qubitro.com/developers/device-communication Example request bodies for the send command endpoint. The first sends a configuration update; the second triggers an OTA firmware download. Both are sent as JSON in the POST request to /v2/projects/{project_id}/devices/{device_id}/communication/command. ```json { "command": "configuration", "data": { "sampling_rate": 60, "threshold_high": 30, "threshold_low": 10, "reporting_interval": 300 } } ``` ```json { "command": "download_firmware", "data": { "file_name": "firmware_v2.1.0.bin" } } ``` -------------------------------- ### Example 200 Response for Delete Aggregated Data Source: https://docs.qubitro.com/developers/aggregated-data Example JSON response for a successful deletion, showing the action, message, status, and success fields. ```json { "action": "delete device", "message": "Operation completed successfully", "status": 200, "success": true } ``` -------------------------------- ### Example Response for Aggregated View (200) Source: https://docs.qubitro.com/developers/aggregated-data Example JSON response for a successful request, showing the standard response envelope with action, data array, message, status, and success fields. ```json { "action": "get blob list", "data": [ { "ANY_ADDITIONAL_PROPERTY": "anything" } ], "message": "", "status": 200, "success": true } ``` -------------------------------- ### PUT request to update a decoder function Source: https://docs.qubitro.com/developers/functions Example HTTP request to fully replace a decoder function configuration. Requires the 'type' query parameter set to 'decoder' and an empty JSON body in this example. ```http PUT /v2/projects/{project_id}/devices/{device_id}/functions/{function_id}?type=decoder HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 2 {} ``` -------------------------------- ### POST /v2/projects Source: https://docs.qubitro.com/developers/projects Creates a new project in your account. Projects are containers for organizing devices and their data. After creation, devices can be added to the project using the devices API. ```APIDOC ## POST /v2/projects ### Description Creates a new project in your account. Projects are containers for organizing devices and their data. After creation, devices can be added to the project using the devices API. ### Method POST ### Endpoint https://api.qubitro.com/v2/projects ### Parameters #### Authorization - **Authorization** (string) - Required - Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here" #### Request Body - **created_at** (string) - Optional - Project creation timestamp (ISO 8601 format, UTC). Example: `2024-01-15T10:30:00Z` - **description** (string) - Optional - Project description (required, max 500 characters). Example: `Production environment IoT devices` - **id** (string) - Optional - Unique project identifier (UUID format). Example: `3e5c0246-c759-48e8-8345-27db13f11ff7` - **name** (string) - Optional - Project name (required, max 100 characters). Example: `Production IoT Fleet` - **tags** (array of strings) - Optional - Optional tags for categorization (alphanumeric and underscore only). Example: `["production","fleet","monitoring"]` ### Request Example ``` POST /v2/projects HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 205 { "created_at": "2024-01-15T10:30:00Z", "description": "Production environment IoT devices", "id": "3e5c0246-c759-48e8-8345-27db13f11ff7", "name": "Production IoT Fleet", "tags": [ "production", "fleet", "monitoring" ] } ``` ### Response #### Success Response (200) - **action** (string) - Optional - Action that was performed. Example: `get blob list` - **data** (object) - Optional - The created project object. May include: `created_at` (string), `description` (string), `id` (string), `name` (string), `tags` (array of strings). - **message** (string) - Optional - Human-readable message (often empty on success) - **status** (integer) - Optional - HTTP status code. Example: `200` - **success** (boolean) - Optional - Operation completed successfully. Example: `true` #### Response Example ``` { "action": "get blob list", "data": { "created_at": "2024-01-15T10:30:00Z", "description": "Production environment IoT devices", "id": "3e5c0246-c759-48e8-8345-27db13f11ff7", "name": "Production IoT Fleet", "tags": [ "production", "fleet", "monitoring" ] }, "message": "", "status": 200, "success": true } ``` #### Error Response (400) Invalid request body - Check required fields and format #### Error Response (401) Unauthorized - Invalid or missing API key ``` -------------------------------- ### GET /v2/projects/{project_id}/devices/{device_id} Source: https://docs.qubitro.com/developers/devices Retrieves detailed information about a specific device including connection credentials. Use this endpoint to get MQTT credentials or HTTP tokens required for device communication. ```APIDOC ## GET /v2/projects/{project_id}/devices/{device_id} ### Description Retrieves detailed information about a specific device including connection credentials. Use this endpoint to get MQTT credentials or HTTP tokens required for device communication. ### Method GET ### Endpoint https://api.qubitro.com/v2/projects/{project_id}/devices/{device_id} ### Parameters #### Path Parameters - **project_id** (string) - Required - Project ID (UUID format). Example: `3e5c0246-c759-48e8-8345-27db13f11ff7` - **device_id** (string) - Required - Device ID. Example: `5f8d0d55b54764ca6f3a1234` #### Authorization - **Authorization** (string) - Required - Enter your API key with the Bearer prefix, e.g. "Bearer QB_your_api_key_here" ### Request Example ``` GET /v2/projects/{project_id}/devices/{device_id} HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Accept: */* ``` ### Response #### Success Response (200) Device retrieved successfully - Includes connection credentials - **action** (string) - Optional - Action that was performed. Example: `get blob list` - **data** (object) - Optional - Device item. Contains properties such as avatar, brand, description, device_credentials, id, last_seen, metadata, model, name, source, tags. - **message** (string) - Optional - Human-readable message (often empty on success) - **status** (integer) - Optional - HTTP status code. Example: `200` - **success** (boolean) - Optional - Operation completed successfully. Example: `true` #### Response Example ``` { "action": "get blob list", "data": { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] }, "message": "", "status": 200, "success": true } ``` #### Error Responses - **401** - Unauthorized - Invalid or missing API key - **404** - Device not found or access denied ``` -------------------------------- ### 200 Success response - Device created with credentials Source: https://docs.qubitro.com/developers/devices Example 200 response after successfully creating a device. The 'data' object contains the device details and the generated connection credentials. The 'message' field is often empty on success. ```json { "action": "get blob list", "data": { "avatar": "https://cdn.qubitro.com/avatars/temperature-sensor.png", "brand": "Custom", "description": "Temperature sensor in warehouse zone A", "device_credentials": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "5f8d0d55b54764ca6f3a1234", "last_seen": "2024-01-15T14:30:00Z", "metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": "Custom", "name": "Temperature Sensor 01", "source": "mqtt", "tags": [ "warehouse", "zone_a", "temperature" ] }, "message": "", "status": 200, "success": true } ``` -------------------------------- ### Create a new project - POST /v2/projects request Source: https://docs.qubitro.com/developers/projects HTTP request to create a new project. Requires a Bearer API key and a JSON body with required fields name and description, and optional tags. ```HTTP POST /v2/projects HTTP/1.1 Host: api.qubitro.com Authorization: YOUR_API_KEY Content-Type: application/json Accept: */* Content-Length: 205 { "created_at": "2024-01-15T10:30:00Z", "description": "Production environment IoT devices", "id": "3e5c0246-c759-48e8-8345-27db13f11ff7", "name": "Production IoT Fleet", "tags": [ "production", "fleet", "monitoring" ] } ```