Cosense icon

Cosense

Read and write pages in Cosense (formerly Scrapbox)

Overview

This node integrates with Cosense (formerly Scrapbox) to manipulate pages within a project. Specifically, the "Insert Lines" operation allows users to insert new lines of text into an existing page at a specified position. This is useful for dynamically updating or augmenting page content without overwriting the entire page.

Common scenarios include:

  • Adding notes or comments to an ongoing project page.
  • Appending code snippets or documentation lines at specific points in a page.
  • Automating incremental updates to project pages based on external data or workflows.

For example, you might use this node to insert meeting minutes after a certain line number in a project page or add new task items to a project documentation page.

Properties

Name Meaning
Project Name The name of your Cosense/Scrapbox project where the page exists.
Page Title The title of the page into which lines will be inserted.
Line Number The line number after which the new text will be inserted. 0 means insertion at the start.
Text The text to insert. Each line in this string becomes a separate line in the Cosense page.

Output

The output is JSON data representing the result of the insertion operation. It typically contains information about the updated page or confirmation of the successful insertion.

  • The output JSON structure depends on the API response from Cosense but generally includes details about the page after modification.
  • No binary data output is produced by this operation.

Dependencies

  • Requires access to the Cosense API via an API key credential configured in n8n.
  • The node uses the Cosense API client internally to communicate with the Cosense service.
  • The user must provide the project name and have appropriate permissions to modify pages in that project.

Troubleshooting

  • Common issues:

    • Incorrect project name or page title may cause the operation to fail because the target page cannot be found.
    • Specifying a line number greater than the current number of lines in the page might lead to unexpected behavior or errors.
    • Missing or invalid API credentials will prevent the node from authenticating with Cosense.
  • Error messages:

    • Errors related to authentication usually indicate missing or invalid API keys; ensure credentials are correctly set up.
    • "Page not found" errors suggest the specified page title does not exist in the given project.
    • Validation errors on input properties (e.g., negative line numbers) should be corrected according to property constraints.

Links and References

Discussion