Phase 2 part 5: Split device management and analytics endpoints - Ratings: get_ratings, create_rating (1-10 scale with half-stars) - Devices: register_device, list_devices, get_devices, revoke_device - Analytics: get_analytics (reading statistics) - Include device registration flow details
1.0 KiB
1.0 KiB
Register Device
Register a new device for sync.
Endpoint: POST /api/devices/register
Auth: Not required (device registration flow)
Content-Type: application/json
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| device_name | string | Yes | Device name |
| device_type | string | Yes | Device type: kobo, koreader, web, mobile |
| device_identifier | string | Yes | Hardware-specific ID |
Example Request
{
"device_name": "My Kobo Clara",
"device_type": "kobo",
"device_identifier": "hardware-specific-id"
}
Response (201 Created)
{
"device_id": "uuid",
"registration_id": "registration-uuid",
"auth_url": "https://bookhoard.com/devices/auth/confirm/abc123",
"qr_code": "data:image/png;base64,iVBORw0KG...",
"expires_in": 300
}
Error Responses
| Code | Description |
|---|---|
| 400 | Invalid device data |
| 409 | Device already registered |