Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Messaging → Create Subscriber

AI-generated

Overview

This node interacts with the Appwrite API to create a subscriber for a messaging topic. It is useful in scenarios where you want to manage messaging subscribers programmatically, such as adding users or devices to receive notifications or messages from a specific topic. For example, you can automate subscriber creation when a new user registers or when a device is added to your system.

Use Case Examples

  1. Create a subscriber for a topic to send targeted notifications.
  2. Add a device ID as a subscriber to a messaging topic for push notifications.

Properties

Name Meaning
Topic ID The ID of the messaging topic to which the subscriber will be added.
Subscriber ID The unique identifier for the subscriber. Can be generated using unique() to ensure uniqueness.
Target ID The target identifier, which can be a user ID or device ID, representing the subscriber's endpoint.

Output

JSON

  • subscriberId - The unique identifier of the created subscriber.
  • topicId - The ID of the topic to which the subscriber was added.
  • targetId - The target ID associated with the subscriber, such as a user or device ID.
  • status - The status of the subscriber creation operation, indicating success or failure.

Dependencies

  • Appwrite API key credential for authentication

Troubleshooting

  • Ensure the Topic ID exists and is valid; otherwise, the subscriber creation will fail.
  • Verify that the Subscriber ID is unique to avoid conflicts.
  • Check that the Target ID corresponds to a valid user or device in the system.
  • Common errors include authentication failures due to invalid API keys or insufficient permissions, which require verifying credentials and access rights.

Links

Discussion