BookStack icon

BookStack

Consume BookStack API

Overview

This node integrates with the BookStack API to manage various resources such as books, pages, chapters, shelves, users, roles, attachments, and tags. Specifically, for the Attachment resource with the Get Many operation, it retrieves multiple attachment records from the BookStack system.

Common scenarios where this node is beneficial include:

  • Fetching all attachments related to a set of books or pages for backup or migration.
  • Listing files uploaded in the documentation system for auditing or reporting.
  • Automating workflows that require processing or analyzing multiple attachments at once.

For example, you could use this node to get all attachments uploaded to your BookStack instance to generate a report on file usage or to synchronize these files with another storage system.

Properties

Name Meaning
Tool Description Choose how to determine the resource and operation:
- Set Automatically
- Set Manually
Request Description (Shown only if "Set Automatically" is selected) Describe what you want to do in natural language. The system will parse this description to select the appropriate resource and operation automatically. Example: "List all attachments"

Note: Since the user requested details only for the Attachment resource and Get Many operation, the relevant properties are limited to these two inputs.

Output

The output is an array of JSON objects representing the retrieved attachments. Each item corresponds to one attachment resource fetched from the BookStack API.

  • The json field contains the full data object returned by the BookStack API for each attachment.
  • There is no binary data output for this operation; attachments are represented as metadata in JSON form.

Example output structure (simplified):

[
  {
    "json": {
      "id": 123,
      "name": "example-file.pdf",
      "path": "/uploads/example-file.pdf",
      "created_at": "2023-01-01T12:00:00Z",
      "updated_at": "2023-01-02T12:00:00Z",
      "uploaded_by": {
        "id": 1,
        "name": "Admin User"
      }
      // ... other attachment metadata fields
    },
    "pairedItem": {
      "item": 0
    }
  },
  ...
]

Dependencies

  • Requires connection to a BookStack instance via its API.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The base URL of the BookStack API must be provided in the credentials.
  • The node uses HTTP GET requests to fetch the list of attachments.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Invalid base URL or network connectivity problems can prevent API access.
    • If the BookStack instance has restricted permissions, the user associated with the API token may not have rights to list attachments.
  • Error messages:

    • Authentication errors typically indicate invalid or expired tokens; verify and update credentials.
    • HTTP 404 or 400 errors may mean incorrect API endpoint or parameters; ensure the resource and operation are correctly specified.
    • Rate limiting or server errors should be handled by retrying after some delay or checking server status.

Links and References

Discussion