🔐 Authentication
All API endpoints require device-specific token authentication:
Authorization: Bearer <device_token>
Each device has a unique token that can be regenerated via the dashboard.
🌐 API Endpoints
POST Fleet Management
POST /fleets/
Purpose: Submit fleet vehicle and vessel data
Example Request:
curl -X POST "https://endpoint.nusatec.id/fleets/" \
-H "Authorization: Bearer YOUR_DEVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"temperature": 25.5,
"speed": 15.2,
"fuel_level": 78.5,
"engine_hours": 1240.5,
"lat": -6.2088,
"lng": 106.8456,
"status": "active"
}'
POST Energy Systems
POST /energy/
Purpose: Submit solar panel and battery system data
curl -X POST "https://endpoint.nusatec.id/energy/" \
-H "Authorization: Bearer YOUR_DEVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"solar_power": 2500.5,
"battery_level": 85.2,
"grid_consumption": 1200.3,
"voltage": 220.5,
"frequency": 50.1,
"temperature": 28.5
}'
POST IoT Sensors
POST /iot/
Purpose: Submit general IoT sensor data
curl -X POST "https://endpoint.nusatec.id/iot/" \
-H "Authorization: Bearer YOUR_DEVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"temperature": 23.2,
"humidity": 65.8,
"light_level": 450,
"motion_detected": false,
"battery_voltage": 3.7,
"lat": -6.1751,
"lng": 106.865
}'
POST Network Nodes
POST /nodes/
Purpose: Submit network node and mesh system data
curl -X POST "https://endpoint.nusatec.id/nodes/" \
-H "Authorization: Bearer YOUR_DEVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"node_id": "NODE_001",
"cpu_usage": 45.2,
"memory_usage": 67.8,
"network_latency": 12.5,
"connections": 145,
"uptime": 86400,
"status": "online"
}'
POST AI Processing
POST /ai/
Purpose: Submit AI/ML processing unit data
curl -X POST "https://endpoint.nusatec.id/ai/" \
-H "Authorization: Bearer YOUR_DEVICE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model_name": "fleet_optimization_v2.1",
"inference_time": 245.7,
"gpu_utilization": 78.9,
"predictions_processed": 1547,
"accuracy_score": 0.967,
"temperature": 65.3,
"power_consumption": 180.4
}'
✅ Response Format
Success Response (HTTP 201):
{
"success": true,
"message": "Data received successfully",
"device_info": {
"device_id": 11,
"device_label": "Solar Panel Monitor",
"device_type": "energy",
"data_id": 9
},
"data": { /* your submitted data */ },
"timestamp": "2025-08-24T21:50:27.907281Z"
}
Error Response (HTTP 4xx):
{
"success": false,
"message": "Invalid device token",
"timestamp": "2025-08-24T21:50:27.907281Z"
}