New frontmatter'd docs with handler-compatible examples: - devices/get_device.md (DeviceInfo shape) - devices/regenerate_device_token.md (token + sync_urls) - devices/get_device_mappings.md (wrapper + DeviceMappingSummary) - devices/update_device_mapping.md (UpdateDeviceMappingRequest) - devices/download_sidecar_config.md (sidecar config JSON file) - devices/link_book.md (LinkBookRequest; one UNVERIFIED marker on required-tag) Schema registry: 6 new entries; DeviceMappingSummary hoisted to package scope. Gate passes (the UNVERIFIED marker is logged, not a failure). Excludes /api/devices-page (htmx page route, per ground rules).
41 lines
982 B
Markdown
41 lines
982 B
Markdown
---
|
|
method: GET
|
|
path: /api/devices/:id/collections
|
|
auth: jwt
|
|
area: devices
|
|
---
|
|
<!-- source: internal/handlers/collections.go:645 CollectionHandler.GetDeviceMappings -->
|
|
|
|
# Get Device Collection Mappings
|
|
|
|
Lists the shelf-to-collection mappings configured for a device.
|
|
|
|
## Example response
|
|
|
|
```json example-response
|
|
{
|
|
"device_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"mappings": [
|
|
{
|
|
"id": "660e8400-e29b-41d4-a716-446655440000",
|
|
"collection_id": "770e8400-e29b-41d4-a716-446655440000",
|
|
"collection_name": "To Read",
|
|
"device_shelf_name": "Kobo",
|
|
"sync_direction": "bidirectional",
|
|
"created_at": "2026-10-24 13:57:01.81234 +0000 UTC"
|
|
}
|
|
],
|
|
"total": 1
|
|
}
|
|
```
|
|
|
|
`created_at` uses Go's `time.String()` format, not RFC3339. `total` is the
|
|
length of `mappings`.
|
|
|
|
## Errors
|
|
|
|
| Status | Body | When |
|
|
| ------ | ---- | ---- |
|
|
| 400 | `{"error": "invalid device id"}` | malformed id |
|
|
| 500 | `{"error": "..."}` | unexpected server error |
|