Create subscriber
Endpoint
posthttps://<REGION>.cloud.appwrite.io...saging/topics/{topicId}/subscribers
Description
Create a new subscriber.
Required scopes
Authentication
setProject() and ensure the user is signed in. The SDK sends the session header automatically after login.Path
Topic ID. The topic ID to subscribe to.
Body
Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
Target ID. The target ID to link to the specified Topic ID.
Subscriber
Subscriber ID.
Subscriber creation time in ISO 8601 format.
Subscriber update date in ISO 8601 format.
Target ID.
Target.
Topic ID.
User Name.
Topic ID.
The target provider type. Can be one of the following: email, sms or push.
import { Client, Messaging } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const messaging = new Messaging(client);
const result = await messaging.createSubscriber({ topicId: '<TOPIC_ID>', subscriberId: '<SUBSCRIBER_ID>', targetId: '<TARGET_ID>'});
console.log(result);Messaging
subscribers
Create subscriber
Endpoint
posthttps://<REGION>.cloud.appwrite.io...saging/topics/{topicId}/subscribers
Description
Create a new subscriber.
Required scopes
Authentication
setProject() and ensure the user is signed in. The SDK sends the session header automatically after login.Path
Topic ID. The topic ID to subscribe to.
Body
Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
Target ID. The target ID to link to the specified Topic ID.
Subscriber
Subscriber ID.
Subscriber creation time in ISO 8601 format.
Subscriber update date in ISO 8601 format.
Target ID.
Target.
Topic ID.
User Name.
Topic ID.
The target provider type. Can be one of the following: email, sms or push.
import { Client, Messaging } from "appwrite";
const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const messaging = new Messaging(client);
const result = await messaging.createSubscriber({ topicId: '<TOPIC_ID>', subscriberId: '<SUBSCRIBER_ID>', targetId: '<TARGET_ID>'});
console.log(result);