magicbell
Version:
MagicBell API wrapper
60 lines • 2.33 kB
JavaScript
;
// This file is generated. Do not update manually!
Object.defineProperty(exports, "__esModule", { value: true });
exports.Broadcasts = void 0;
const resource_js_1 = require("../client/resource.js");
const notifications_js_1 = require("./broadcasts/notifications.js");
class Broadcasts extends resource_js_1.Resource {
path = 'broadcasts';
entity = 'broadcast';
notifications = new notifications_js_1.BroadcastsNotifications(this.client);
/**
* Create a broadcast to send notifications to upto a 1,000 recipients - users or
* topic subscribers. You can identify users by their email address or by an
* external_id.
*
* You don't have to import your users into MagicBell. If a user does not exist
* we'll create it automatically.
*
* You can send user attributes like first_name, custom_attributes, and more when
* creating a broadcast.
*
* A new notification will be shown in the inbox of each recipient in real-time. It
* will also be delivered to each recipient through all channels you have enabled
* for your project.
*
* @param data
* @param options - override client request options.
* @returns A broadcast is a precursor to a notification. When you specify multiple
* recipients, MagicBell creates a notification for each recipient and delivers it
* to them based on their preferences.
**/
create(data, options) {
return this.request({
method: 'POST',
}, data, options);
}
list(dataOrOptions, options) {
return this.request({
method: 'GET',
paged: true,
}, dataOrOptions, options);
}
/**
* Fetch a broadcast by its ID.
*
* @param broadcastId - ID of the broadcast.
* @param options - override client request options.
* @returns A broadcast is a precursor to a notification. When you specify multiple
* recipients, MagicBell creates a notification for each recipient and delivers it
* to them based on their preferences.
**/
get(broadcastId, options) {
return this.request({
method: 'GET',
path: '{broadcast_id}',
}, broadcastId, options);
}
}
exports.Broadcasts = Broadcasts;
//# sourceMappingURL=broadcasts.js.map