BookStack icon

BookStack

Consume BookStack API

Overview

This node integrates with the BookStack API to manage various BookStack resources such as books, pages, chapters, shelves, users, roles, attachments, and tags. Specifically for the Role resource with the Create operation, it allows users to create new roles within BookStack.

The node supports two modes of operation:

  • Automatic mode: Users provide a natural language description of their request (e.g., "Create a new role for editors"), and the node attempts to parse this description to determine the appropriate resource and operation.
  • Manual mode: Users explicitly select the resource ("Role") and operation ("Create") and provide the necessary input properties.

Typical use cases include automating the creation of roles in BookStack for managing permissions or organizing user access without manually interacting with the BookStack UI or API.

Example: Automatically creating a new role by describing the request as "Create a new role for content editors" or manually specifying the role details.

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) A text description of what you want to do; the system will parse this to select the resource and operation automatically

For the Role - Create operation specifically, no additional input properties are defined in the provided snippet beyond these general ones. The node relies on either the automatic parsing of the request description or manual selection of resource and operation.

Output

The node outputs an array of JSON objects corresponding to the responses from the BookStack API for each input item processed.

  • Each output item contains a json field with the API response data related to the created role.
  • No binary data output is indicated.

The structure of the JSON depends on the BookStack API's response for role creation, typically including details about the newly created role such as its ID, name, and permissions.

Dependencies

  • Requires connection to a BookStack instance via its API.
  • Needs an API authentication token credential configured in n8n with:
    • Base URL of the BookStack API
    • Token and token secret for authorization
  • The node uses HTTP requests with JSON payloads to communicate with the BookStack API.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Improperly formatted request descriptions in automatic mode may lead to incorrect resource or operation detection.
    • Missing required fields when manually creating a role can result in API errors.
  • Error messages:

    • Authentication errors: Check that the API token and base URL are correctly set.
    • Validation errors from the API: Ensure all required parameters for role creation are provided.
    • Parsing errors in automatic mode: Simplify or clarify the request description to improve detection accuracy.

Links and References

Discussion