Files
bookhoard/bruno/devices/Get Device File Aliases.bru
T

79 lines
1.7 KiB
Plaintext

meta {
name: Get Device File Aliases
type: http
seq: 1
}
get {
url: {{base_url}}/api/devices/{{device_id}}/file-aliases
auth: inherit
}
headers {
Content-Type: application/json
}
tests {
test_get_device_file_aliases_success(status, headers, body) {
if (status !== 200) {
throw new Error("Expected status 200, got " + status);
}
const contentType = headers["content-type"];
if (!contentType || !contentType.includes("application/json")) {
throw new Error("Expected content-type to contain application/json");
}
let data;
try {
data = JSON.parse(body);
} catch (e) {
throw new Error("Response body is not valid JSON");
}
if (!Array.isArray(data)) {
throw new Error("Expected response body to be an array");
}
return true;
}
}
vars:pre-request {
deviceId: "8821b703-1234-5678-9123-446655440002"
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Get Device File Aliases
Retrieves all file aliases for a specific device. File aliases are used to map device-specific file paths to media items.
**Method:** GET
**Endpoint:** /api/devices/:id/file-aliases
**Authentication:** Required (Bearer token)
**Path Parameters:**
- `id` (string, required): Device UUID
**Response:** Array of file alias objects
- `id` (string): Alias UUID
- `device_id` (string): Device UUID
- `file_path` (string): Device-specific file path
- `media_item_id` (string): Associated media item UUID
- `created_at` (string): Creation timestamp
- `updated_at` (string): Last update timestamp
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 404: Device not found
- 500: Internal server error
}