EcoThermiq logo

EcoThermiq API

v3.0
Overview

The EcoThermiq API allows IoT devices to push temperature sensor readings and provides full CRUD management for customers, devices, addresses, services and more. All communication uses JSON over HTTPS.

Base URL: https://your-domain.com/api/

Every CRUD endpoint supports: GET (list/single), POST (add), PUT (update), DELETE (delete). Alternatively use POST?action=update or POST?action=delete.

Schema Database Tables
Customer
  • CustomerId PK AUTO
  • CustomerNumber
  • IsReseller
  • ResellerNumber FK→Customer
  • FirstName
  • Prefix
  • LastName
CustomerApi
  • CustomerApiId PK AUTO
  • CustomerId FK→Customer
  • CustomerApiKey
CustomerLogin
  • CustomerLoginId PK AUTO
  • CustomerId FK→Customer
  • LoginName
  • LoginPassword (bcrypt)
ApplicationRole
  • ApplicationRoleId PK AUTO
  • ApplicationRoleName
CustomerLoginApplicationRole
  • …RoleId PK AUTO
  • CustomerLoginId FK→CustomerLogin
  • ApplicationRoleId FK→ApplicationRole
Country
  • CountryId PK AUTO
  • CountryName
  • LanguageCode (ISO 639-1)
AddressType
  • AddressTypeId PK AUTO
  • AddressTypeName
Address
  • AddressId PK AUTO
  • CustomerId FK→Customer
  • AddressTypeId FK→AddressType
  • Street
  • StreetNumber
  • ZipCode
  • CountryId FK→Country
ServiceType
  • ServiceTypeId PK AUTO
  • ServiceTypeName
  • ServiceDescription
  • MonthlyFee
CustomerServiceType
  • …TypeId PK AUTO
  • CustomerId FK→Customer
  • ServiceTypeId FK→ServiceType
  • Discount (%)
  • StartDate
  • EndDate
DeviceType
  • DeviceTypeId PK AUTO
  • DeviceType
SensorType
  • SensorTypeId PK AUTO
  • SensorType
Device
  • DeviceId PK
  • CustomerId FK→Customer
  • DeviceTypeId FK→DeviceType
DeviceMeasurement Temperature
  • MeasurementId PK AUTO
  • DeviceId FK→Device
  • DateTime
  • sensor_technical_id
  • sensor_temperature_kelvin
…TemperatureHistory
  • HistoryId PK AUTO
  • DeviceId FK→Device
  • DateTime
  • sensor_technical_id
  • sensor_temperature_kelvin
API Endpoints

Every CRUD endpoint accepts GET (list/single by PK), POST (add), PUT (update), DELETE (delete).

CRUD/api/customerManage customers
CRUD/api/customer_apiAPI keys per customer
CRUD/api/customer_loginLogin credentials (bcrypt)
CRUD/api/application_roleRoles: Admin, User, etc.
CRUD/api/customer_login_application_roleAssign roles to logins
CRUD/api/countryCountries + language codes
CRUD/api/address_typePost / Invoice / Residential
CRUD/api/addressCustomer addresses
CRUD/api/service_typeService plans & fees
CRUD/api/customer_service_typeSubscriptions + discounts
CRUD/api/device_typeDevice types
CRUD/api/sensor_typeSensor types
CRUD/api/deviceDevices per customer
CRUD/api/device_measurement_temperatureTemperature readings
GET/api/device_measurement_temperature_historyAudit log (read-only)
POST/api/temperatureIoT device data ingestion
CRUD Usage Pattern

All CRUD endpoints follow the same pattern. Example using /api/customer:

GET – List all (with optional filters)
curl "http://your-domain.com/api/customer?limit=10&offset=0"

# Filter by column:
curl "http://your-domain.com/api/customer?IsReseller=1"

# Get single by PK:
curl "http://your-domain.com/api/customer?CustomerId=5"
POST – Add new record
curl -X POST http://your-domain.com/api/customer \
  -H "Content-Type: application/json" \
  -d '{
    "CustomerNumber": "CUST-001",
    "FirstName": "Jan",
    "Prefix": "van",
    "LastName": "Dijk",
    "IsReseller": 0
  }'
PUT – Update record
curl -X PUT http://your-domain.com/api/customer \
  -H "Content-Type: application/json" \
  -d '{
    "CustomerId": 5,
    "LastName": "de Vries"
  }'
DELETE – Delete record
curl -X DELETE http://your-domain.com/api/customer \
  -H "Content-Type: application/json" \
  -d '{ "CustomerId": 5 }'
POST /api/temperature – IoT Ingestion

Submit temperature sensor readings from a device. The DateTime ISO 8601 timestamp (e.g. 2026-04-21T23:50:05Z) is converted to a MySQL DATETIME automatically. Authentication is via customer_api key stored in the CustomerApi table.

Request Body – application/json
{
  "solution": "EcoThermiq",
  "customer": {
    "customer_number": "CUST-001",
    "DeviceId": "Dvesdf1234",
    "customer_api": "api_key_abc123",
    "DateTime": "2026-04-21T23:50:05Z"
  },
  "temperature_sensors": [
    {
      "sensor_number": "S001",
      "sensor_technical_id": "sensor_id_001",
      "sensor_name": "Temperature Sensor 1",
      "sensor_temperature_celsius": 25.0,
      "sensor_temperature_fahrenheit": 77.0,
      "sensor_temperature_kelvin": 298.15
    },
    {
      "sensor_number": "S002",
      "sensor_technical_id": "sensor_id_002",
      "sensor_name": "Temperature Sensor 2",
      "sensor_temperature_celsius": 30.0,
      "sensor_temperature_fahrenheit": 86.0,
      "sensor_temperature_kelvin": 303.15
    }
  ]
}
201 Created
{
  "status": "success",
  "data": {
    "message": "Temperature data saved successfully.",
    "customer_number": "CUST-001",
    "device_id": "Dvesdf1234",
    "datetime": "2026-04-21 23:50:05",
    "measurements_saved": 2
  }
}
401 Unauthorized
{
  "status": "error",
  "message": "Invalid API key."
}
Response Format

All endpoints return JSON with status ("success" or "error"). Success responses include a data object. Error responses include a message and optionally an errors array with field names.