UNPKG

telesignenterprisesdk

Version:

This SDK enhances the functionality of the Telesign Self-service Node SDK, providing access to a broader range of Telesign APIs. See our source code on GitHub (https://github.com/TeleSign/node_telesign_enterprise) for installation instructions and other d

30 lines (26 loc) 1.08 kB
const Telesign = require('telesignsdk'); /** * Telesign Messaging allows you to easily send a message to the target recipient using any of Telesign's supported channels. */ class Messaging { constructor(customerId, apiKey, restEndpoint="https://rest-ww.telesign.com", timeout=10000, userAgent=null) { this.rest = new Telesign(customerId, apiKey, restEndpoint, timeout, userAgent).rest; this.omniMessageResource = "/v1/omnichannel" } /** * Send a message to the target recipient using any of Telesign's supported channels. * @param params All required and optional parameters well-structured according to the API documentation. * <p> * See https://developer.telesign.com/enterprise/reference/sendadvancedmessage for detailed API documentation. * </p> */ omniMessage(callback, params = {}) { this.rest.setContentType("application/json") this.rest.execute(callback, "POST", this.omniMessageResource, params); } } module.exports = Messaging;