Mastodon icon

Mastodon

Interact with Mastodon API

Overview

This node interacts with the Mastodon API, a decentralized social networking platform. Specifically, the "Notifications" resource with the "Get Unread Count" operation allows users to retrieve the number of unread notifications from a specified Mastodon instance.

Common scenarios where this node is beneficial include:

  • Monitoring unread notifications on a Mastodon account to trigger alerts or workflows.
  • Integrating Mastodon notification counts into dashboards or reporting tools.
  • Automating responses or actions based on the number of unread notifications.

For example, a user could set up an automation that checks their Mastodon unread notifications count every hour and sends a summary email if there are any unread items.

Properties

Name Meaning
Mastodon URL The URL of the Mastodon instance to connect to (e.g., https://mastodon.social). This specifies which Mastodon server the node will query for notifications.

Output

The output JSON contains the data returned by the Mastodon API for unread notifications count. Typically, this includes a numeric count representing how many notifications have not yet been read by the user.

The structure is generally:

{
  "unread_count": <number>
}

Where unread_count is the integer count of unread notifications.

No binary data output is expected from this operation.

Dependencies

  • Requires an API authentication token credential configured in n8n to authenticate requests to the Mastodon instance.
  • The Mastodon instance URL must be provided as input.
  • Network access to the specified Mastodon instance is necessary.

Troubleshooting

  • Common issues:

    • Incorrect or missing Mastodon instance URL can cause connection failures.
    • Invalid or expired API authentication tokens will result in authorization errors.
    • If the Mastodon instance is down or unreachable, the node will fail to fetch data.
  • Error messages:

    • "The operation "Get Unread Count" for resource "Notifications" is not implemented!" indicates a misconfiguration or unsupported operation.
    • Network or HTTP errors typically indicate connectivity or credential problems.
  • Resolutions:

    • Verify the Mastodon URL is correct and accessible.
    • Ensure the API authentication token is valid and has required permissions.
    • Check network connectivity and Mastodon server status.

Links and References

Discussion