Mastodon icon

Mastodon

Interact with Mastodon API

Overview

This node allows users to interact with the Mastodon social network API, specifically focusing on polls in this context. The "Vote on Poll" operation enables users to submit their votes to a specific poll on a Mastodon instance.

Common scenarios where this node is beneficial include:

  • Automating participation in polls on Mastodon without manual interaction.
  • Integrating Mastodon poll voting into larger workflows, such as reacting to events or data changes.
  • Collecting and submitting user choices programmatically for analytics or engagement purposes.

For example, a marketing automation workflow could use this node to vote on polls related to brand sentiment or product feedback on Mastodon.

Properties

Name Meaning
Mastodon URL The base URL of the Mastodon instance to connect to (e.g., https://mastodon.social).
Poll ID The unique identifier of the poll on which to vote.
Choices An array of zero-based indices representing the selected options to vote for in the poll.

Output

The output contains JSON objects representing the response from the Mastodon API after submitting the vote. This typically includes confirmation of the vote submission and may contain updated poll data or status information.

No binary data output is involved in this operation.

Dependencies

  • Requires an API authentication token credential configured in n8n to authenticate requests to the Mastodon instance.
  • Needs access to the specified Mastodon instance URL.
  • The node depends on the Mastodon API's availability and correct configuration of OAuth2 credentials.

Troubleshooting

  • Common Issues:

    • Incorrect or missing Mastodon instance URL can cause connection failures.
    • Invalid or expired API authentication tokens will result in authorization errors.
    • Providing invalid poll IDs or choice indices that do not exist in the poll will cause API errors.
  • Error Messages:

    • "The operation "vote" for resource "polls" is not implemented!" — indicates a misconfiguration or unsupported operation; ensure the node version supports this operation.
    • API errors returned by Mastodon, such as unauthorized access or invalid parameters, should be checked and resolved by verifying credentials and input values.
  • Resolutions:

    • Verify the Mastodon URL is correct and accessible.
    • Ensure the API authentication token is valid and has necessary permissions.
    • Double-check the poll ID and choice indices correspond to an existing poll and valid options.

Links and References

Discussion