From c232992f0bf33cc375f6ebeeaddd8030f70b648e Mon Sep 17 00:00:00 2001 From: Maksym Novozhylov Date: Fri, 18 Sep 2020 15:13:51 +0200 Subject: [PATCH] Add sendMessageToRooms --- CHANGES.md | 3 +++ lib/routers/messages.js | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 370ed9a..4426922 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Release History +## 2.1.2 +* Send Message to a Batch of Rooms API + ## 2.1.1 * Add Room Messages API * Sync-up routers with OAuth1 version diff --git a/lib/routers/messages.js b/lib/routers/messages.js index cb425da..be2eb5d 100644 --- a/lib/routers/messages.js +++ b/lib/routers/messages.js @@ -65,7 +65,7 @@ exports.Messages.prototype.getRoomDetails = function(company, roomId, params, ca /** * Get messages from a specific room * - * @method getRoomDetails + * @method getRoomMessages * @param company {String} Company ID * @param roomId {String} Room ID * @param params {Hash} Parameters @@ -157,6 +157,21 @@ exports.Messages.prototype.sendMessageToRoom = function(company, roomId, params, this.api.client.post('messages/v3/' + company + '/rooms/' + roomId + '/stories', params, callback); } +/** + * Send a message to a batch of rooms + * + * @method sendMessageToRooms + * @param company {String} Company ID + * @param params {Hash} Parameters + * @param callback {String} Callback function + * @async + */ +exports.Messages.prototype.sendMessageToRooms = function(company, params, callback) { + params = params || {}; + debug('running request'); + this.api.client.post('messages/v3/' + company + '/stories/batch', params, callback); +} + /** * Update a room settings *