Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bandwidth/messaging

Package Overview
Dependencies
Maintainers
15
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bandwidth/messaging

Bandwidth's HTTP Messaging platform

  • 2.0.2
  • npm
  • Socket score

Version published
Weekly downloads
9.2K
decreased by-6.54%
Maintainers
15
Weekly downloads
 
Created
Source

Getting started

Other Node SDKs

  • Numbers: https://github.com/Bandwidth/node-numbers
  • Voice: https://github.com/Bandwidth/node-voice

Installation

npm install @bandwidth/messaging

Initialization

Authentication

In order to setup authentication in the API client, you need the following information.

ParameterDescription
basicAuthUserNameThe username to use with basic authentication
basicAuthPasswordThe password to use with basic authentication

API client can be initialized as following:

const BandwidthMessaging = require('@bandwidth/messaging');

// Configuration parameters and credentials
BandwidthMessaging.Configuration.basicAuthUserName = "apitoken"; // The username to use with basic authentication
BandwidthMessaging.Configuration.basicAuthPassword = "apisecret"; // The password to use with basic authentication

Class Reference

List of Controllers

Class: APIController

Get singleton instance

The singleton instance of the APIController class can be accessed from the API Client.

var controller = BandwidthMessaging.APIController;

Method: createMessage

createMessage

function createMessage(userId, body, callback)
Parameters
ParameterTagsDescription
userIdRequiredTODO: Add a parameter description
bodyOptionalTODO: Add a parameter description
Example Usage

    var userId = 'userId';
    var body = new BandwidthMessaging.MessageRequest({"key":"value"});

    controller.createMessage(userId, body, function(error, response, context) {

    
    });
Errors
Error CodeError Description
400400 Request is malformed or invalid
401401 The specified user does not have access to the account
403403 The user does not have access to this API
404404 Path not found
415415 The content-type of the request is incorrect
429429 The rate limit has been reached

Method: listMedia

listMedia

function listMedia(userId, continuationToken, callback)
Parameters
ParameterTagsDescription
userIdRequiredTODO: Add a parameter description
continuationTokenOptionalTODO: Add a parameter description
Example Usage

    var userId = 'userId';
    var continuationToken = 'Continuation-Token';

    controller.listMedia(userId, continuationToken, function(error, response, context) {

    
    });
Errors
Error CodeError Description
400400 Request is malformed or invalid
401401 The specified user does not have access to the account
403403 The user does not have access to this API
404404 Path not found
415415 The content-type of the request is incorrect
429429 The rate limit has been reached

Method: getMedia

getMedia

function getMedia(userId, mediaId, callback)
Parameters
ParameterTagsDescription
userIdRequiredTODO: Add a parameter description
mediaIdRequiredTODO: Add a parameter description
Example Usage

    var userId = 'userId';
    var mediaId = 'mediaId';

    controller.getMedia(userId, mediaId, function(error, response, context) {

    });
Errors
Error CodeError Description
400400 Request is malformed or invalid
401401 The specified user does not have access to the account
403403 The user does not have access to this API
404404 Path not found
415415 The content-type of the request is incorrect
429429 The rate limit has been reached

Method: uploadMedia

uploadMedia

function uploadMedia(userId, mediaId, contentLength, body, contentType, cacheControl, callback)
Parameters
ParameterTagsDescription
userIdRequiredTODO: Add a parameter description
mediaIdRequiredTODO: Add a parameter description
contentLengthRequiredTODO: Add a parameter description
bodyRequiredTODO: Add a parameter description
contentTypeOptionalTODO: Add a parameter description
cacheControlOptionalTODO: Add a parameter description
Example Usage

    var userId = 'userId';
    var mediaId = 'mediaId';
    var contentLength = 217;
    var body = 'body';
    var contentType = 'Content-Type';
    var cacheControl = 'Cache-Control';

    controller.uploadMedia(userId, mediaId, contentLength, body, contentType, cacheControl, function(error, response, context) {

    
    });
Errors
Error CodeError Description
400400 Request is malformed or invalid
401401 The specified user does not have access to the account
403403 The user does not have access to this API
404404 Path not found
415415 The content-type of the request is incorrect
429429 The rate limit has been reached

Method: deleteMedia

deleteMedia

function deleteMedia(userId, mediaId, callback)
Parameters
ParameterTagsDescription
userIdRequiredTODO: Add a parameter description
mediaIdRequiredTODO: Add a parameter description
Example Usage

    var userId = 'userId';
    var mediaId = 'mediaId';

    controller.deleteMedia(userId, mediaId, function(error, response, context) {

    
    });
Errors
Error CodeError Description
400400 Request is malformed or invalid
401401 The specified user does not have access to the account
403403 The user does not have access to this API
404404 Path not found
415415 The content-type of the request is incorrect
429429 The rate limit has been reached

Back to List of Controllers

FAQs

Package last updated on 30 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc