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 Tag resource with the Create operation, it allows users to create new tags within their BookStack instance.

The node supports two modes of operation:

  • Automatic mode: Users provide a natural language description of what they want to do (e.g., "Create a new tag for project management"), and the node attempts to parse this description to determine the appropriate resource and operation.
  • Manual mode: Users explicitly select the resource (Tag) and operation (Create), then provide the required parameters.

Typical use cases include automating content organization by creating tags programmatically, integrating BookStack tagging into workflows, or dynamically managing metadata in documentation projects.

Properties

Name Meaning
Tool Description Choose how to determine the resource and operation: either "Set Automatically" or "Set Manually".
Request Description (Shown only if "Set Automatically" is selected) A text input where you describe your request in natural language, e.g., "Create a new tag for API documentation". The system uses this to infer the resource and operation automatically.

For the Tag - Create operation specifically, no additional manual properties are shown based on the provided code snippet and property definitions. The node relies on 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 each input item processed. Each output item contains the response from the BookStack API after performing the requested operation.

  • The json field includes the full API response for the created Tag resource, typically containing details such as the tag's ID, name, and other metadata returned by BookStack.
  • No binary data output is indicated for this node.

Example output structure (simplified):

{
  "json": {
    "id": 123,
    "name": "example-tag",
    "created_at": "2024-01-01T12:00:00Z",
    // other tag properties as returned by BookStack API
  }
}

Dependencies

  • Requires an API key credential for authenticating with the BookStack API.
  • The node expects the base URL and authentication tokens to be configured in the credentials.
  • HTTP requests are made to the BookStack API endpoints, e.g., /tags for tag operations.
  • No additional external dependencies beyond the BookStack API and n8n's HTTP request capabilities.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Providing an ambiguous or unclear request description in automatic mode may lead to incorrect resource or operation detection.
    • Missing required fields when manually setting parameters can cause API errors.
  • Error messages:

    • Authentication errors usually indicate invalid or expired API tokens; verify and update credentials.
    • Validation errors from the API may indicate missing required fields like tag name; ensure all mandatory inputs are provided.
    • Network or connectivity errors suggest checking the base URL configuration and network access.
  • Resolution tips:

    • Use manual mode if automatic detection does not correctly interpret your request.
    • Check the BookStack API documentation for required fields when creating tags.
    • Enable debug logging (as seen in the source code) to trace request formation and responses.

Links and References

Discussion