BookStack icon

BookStack

Consume BookStack API

Overview

This node integrates with the BookStack API to manage various BookStack resources, including Attachments. Specifically, for the Attachment resource with the Create operation, it allows users to upload or create new attachments within the BookStack system. The node supports two modes: automatic and manual configuration of the resource and operation.

Common scenarios where this node is beneficial include:

  • Automating the creation of attachments (files) related to books, pages, or chapters in BookStack.
  • Integrating external workflows that generate or collect files and need to upload them into BookStack automatically.
  • Using natural language descriptions to automatically determine the appropriate resource and operation, simplifying user interaction.

Practical example:

  • A user wants to add a new attachment file to a page in BookStack. They can describe their request in natural language (e.g., "Add a new attachment to the API documentation page"), and the node will automatically detect the correct resource and operation to perform the upload.

Properties

Name Meaning
Tool Description Choose how to determine the resource and operation. Options: "Set Automatically", "Set Manually".
Request Description When "Set Automatically" is selected, describe your request in natural language. The system uses this description to select the appropriate resource and operation automatically. Example: "Create a new page about API documentation".

Note: For the Attachment resource and Create operation, only these properties are relevant based on the provided input properties.

Output

The node outputs an array of JSON objects corresponding to each input item processed. Each output object contains:

  • json: The JSON response from the BookStack API representing the created attachment resource. This typically includes details such as the attachment ID, name, URL, and metadata returned by the API.

If the node encounters an error during processing and "Continue On Fail" is enabled, the output JSON will contain an error field with the error message.

The node does not explicitly handle binary data output for attachments in the provided code; it focuses on JSON responses from the API.

Dependencies

  • Requires an API key credential for authenticating with the BookStack API.
  • The node expects the BookStack API base URL and authentication tokens to be configured in the credentials.
  • HTTP requests are made to the BookStack API endpoints using standard REST methods (POST for create).
  • No additional external dependencies beyond the BookStack API and its authentication.

Troubleshooting

  • Common issues:

    • Incorrect or missing API credentials will cause authentication failures.
    • Providing an invalid or incomplete request description when using automatic mode may lead to incorrect resource or operation detection.
    • Missing required fields for creating attachments (not detailed in the snippet but generally required by the API) can cause API errors.
  • Error messages:

    • Authentication errors: Ensure the API token and base URL are correctly set in the credentials.
    • Validation errors from the API: Check that all required parameters for creating an attachment are provided.
    • Parsing or detection errors in automatic mode: Try switching to manual mode and explicitly selecting the resource and operation.

Links and References

Discussion