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 Attachment resource with the Copy operation, it allows duplicating an existing attachment within BookStack.

The node supports two modes of operation:

  • Automatic mode: You describe your request in natural language, and the node attempts to infer the resource and operation.
  • Manual mode: You explicitly specify the resource and operation.

Use cases for copying an attachment include duplicating files or documents attached to pages or other resources in BookStack, which can be useful when reusing content or creating backups.

Example scenario:
You have an attachment (e.g., a PDF file) linked to a page and want to create a copy of this attachment elsewhere without manually downloading and re-uploading it.

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 your request in natural language; the system will try to select the appropriate resource and operation automatically

For the Attachment - Copy operation specifically, the key input property used is:

Name Meaning
ID The ID of the attachment resource you want to copy. This is required to identify which attachment to duplicate.

Note: The bundled code does not explicitly show additional properties specific to the Attachment Copy operation beyond the generic id parameter inherited from the resource operations.

Output

The node outputs JSON data representing the response from the BookStack API after performing the copy operation. This typically includes details of the newly created copied attachment, such as its new ID and metadata.

The output structure is:

{
  "json": {
    // API response object for the copied attachment
  },
  "pairedItem": {
    "item": <index_of_input_item>
  }
}

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential for authenticating with the BookStack API.
  • The base URL and authentication tokens must be configured in the node credentials.
  • The node uses HTTP requests to communicate with the BookStack REST API endpoints.

Troubleshooting

  • Common issues:

    • Invalid or missing attachment ID: Ensure the ID provided corresponds to an existing attachment.
    • Authentication errors: Verify that the API token and base URL are correctly set in the credentials.
    • Permission errors: The API user must have rights to copy attachments in BookStack.
    • Network or connectivity problems: Confirm network access to the BookStack server.
  • Error messages:

    • Errors returned by the BookStack API will be included in the node output if "Continue On Fail" is enabled.
    • Typical HTTP error codes like 401 (Unauthorized), 404 (Not Found), or 403 (Forbidden) indicate credential or permission issues.
    • To resolve, check credentials, permissions, and the validity of the attachment ID.

Links and References

Discussion