Files
bookhoard/bruno/library/Get Libraries (Admin).yml
T
john-okeefe e2d2dbecab chore(bruno): update library API collection and add dev DB setup
Update all library API request files to the current Bruno format
with proper settings blocks, updated sequence numbers, and cleaner
YAML formatting.

Add NewDevDBSetup collection with requests for creating comic, ebook,
and manga libraries, user registration, and folder configuration to
speed up development environment setup.
2026-04-19 14:27:35 -04:00

70 lines
1.8 KiB
YAML

info:
name: Get Libraries (Admin)
type: http
seq: 3
http:
method: GET
url: "{{base_url}}/api/libraries"
headers:
- name: ""
value: application/json
auth: inherit
runtime:
scripts:
- type: after-response
code: |-
function onResponse(res) {
try {
const responseBody = res.getBody();
const id = responseBody.data[0].id;
if (id) {
bru.setEnvVar("library_id", id, { persist: true });
console.log("Library ID saved:", id);
}
if (!id) {
console.log("No id found in response.");
}
} catch (error) {
console.error("Error in post-response script:", error.message);
}
}
onResponse(res);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Get Libraries (Admin)
Retrieves all libraries in the system (admin access required).
**Method:** GET
**Endpoint:** /api/libraries
**Authentication:** Required (Bearer token, admin permissions)
**Response:** Array of library objects
- `id` (string): Library UUID
- `name` (string): Library name
- `description` (string, optional): Library description
- `type` (string): Library type (ebooks, audiobooks, videos, other)
- `is_visible` (boolean): Library visibility to users
- `media_count` (number): Number of media items in library
- `folder_count` (number): Number of folders associated
- `created_at` (string): Creation timestamp
- `updated_at` (string): Last update timestamp
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 403: Forbidden (admin access required)
- 500: Internal server error