REST API (Django REST Framework)
The XPARO REST API allows robots, clients, and backend services to communicate with the XPARO platform using HTTP requests.
This API is primarily used for:
Robot registration
Telemetry and log submission
Uploading ROS2 bag recordings
Sending chatbot messages
Managing robot sessions
Updating configuration files
The API is implemented using Django REST Framework (DRF).
Base URL
`
https://xparo-website.onrender.com/
`
Example endpoint
`
https://xparo-website.onrender.com/api/upload_rosbag/
`
Authentication
Most endpoints require authentication using either a Project Secret Key or an API Token.
Header authentication
Authorization: Bearer <API_TOKEN>
URL authentication
POST /chatbot_api/<secret_key>/<project_id>/
Common endpoints
Endpoint |
Method |
Description |
|---|---|---|
|
POST |
Send message to chatbot |
|
POST |
Upload ROS2 bag files |
|
POST |
Register or update robot info |
|
POST |
Create logging session |
|
POST |
Update telemetry logs |
|
GET |
Retrieve configuration files |
Chatbot API
Endpoint
`
POST /chatbot_api/<secret_key>/<project_id>/
`
Request body (JSON)
{
"message": "Hello robot",
"robot_id": "robot_123",
"session_id": "session_456"
}
Response example
{
"response": "Hello, how can I assist you?",
"actions": [],
"behavior_update": false
}
Robot registration
Endpoint
`
POST /api/robot-info/
`
Request example
{
"robot_id": "robot_123",
"os": "Ubuntu 24.04",
"cpu": "ARM64",
"memory": "8GB",
"ip_address": "192.168.1.10",
"display": "1920x1080"
}
Response
{
"status": "registered",
"robot_id": "robot_123"
}
Logging session
Endpoint
`
POST /api/log-session/
`
Request
{
"robot_id": "robot_123",
"project_id": "project_abc"
}
Response
{
"session_id": "session_987",
"status": "active"
}
Update telemetry
Endpoint
`
POST /api/update-logs/
`
Request example
{
"session_id": "session_987",
"cpu_usage": 45,
"memory_usage": 62,
"disk_usage": 30,
"logs": [
"Node started",
"Navigation goal received"
]
}
Response
{
"status": "updated"
}
Upload ROS2 bag files
Endpoint
`
POST /api/upload_rosbag/
`
Headers
Authorization: Bearer <API_TOKEN>
Multipart request fields
file: multipart file upload (the .mcap file)robot_id: robot identifiertimestamp: epoch timestamp
Response
{
"status": "uploaded",
"file": "bag_2026_03_06.mcap"
}
Configuration API
Endpoint
`
GET /api/config/
`
Response example
{
"behavior_tree": "<xml>...</xml>",
"maps": "...",
"properties": "...",
"sets": "..."
}
Error responses
Common error codes:
400 — Invalid request
401 — Authentication failed
403 — Permission denied
404 — Resource not found
500 — Internal server error
Example:
{
"error": "Authentication failed"
}
Security
Always use HTTPS
Store API tokens securely
Rotate tokens periodically
Validate incoming robot IDs
Versioning
The live API is versioned. Example patterns:
/api/v1/.../api/v2/...
Contact
Email:
xpassistantpersonal@gmail.comRepo:
https://github.com/lazyxcientist/Website:
https://xparo-website.onrender.com/