@bandwidth/messaging
Bandwidth's HTTP Messaging platform
Last updated 2 months ago by developerhelp-bandwidth .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @bandwidth/messaging 
SYNC missed versions from official npm registry.

Getting started

Other Node SDKs

Installation

npm install @bandwidth/messaging

Initialization

Authentication

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

Parameter Description
basicAuthUserName The username to use with basic authentication
basicAuthPassword The 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

Parameter Tags Description
userId Required TODO: Add a parameter description
body Optional TODO: 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 Code Error Description
400 400 Request is malformed or invalid
401 401 The specified user does not have access to the account
403 403 The user does not have access to this API
404 404 Path not found
415 415 The content-type of the request is incorrect
429 429 The rate limit has been reached

Method: listMedia

listMedia

function listMedia(userId, continuationToken, callback)

Parameters

Parameter Tags Description
userId Required TODO: Add a parameter description
continuationToken Optional TODO: Add a parameter description

Example Usage


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

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

    
    });

Errors

Error Code Error Description
400 400 Request is malformed or invalid
401 401 The specified user does not have access to the account
403 403 The user does not have access to this API
404 404 Path not found
415 415 The content-type of the request is incorrect
429 429 The rate limit has been reached

Method: getMedia

getMedia

function getMedia(userId, mediaId, callback)

Parameters

Parameter Tags Description
userId Required TODO: Add a parameter description
mediaId Required TODO: Add a parameter description

Example Usage


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

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

    });

Errors

Error Code Error Description
400 400 Request is malformed or invalid
401 401 The specified user does not have access to the account
403 403 The user does not have access to this API
404 404 Path not found
415 415 The content-type of the request is incorrect
429 429 The rate limit has been reached

Method: uploadMedia

uploadMedia

function uploadMedia(userId, mediaId, contentLength, body, contentType, cacheControl, callback)

Parameters

Parameter Tags Description
userId Required TODO: Add a parameter description
mediaId Required TODO: Add a parameter description
contentLength Required TODO: Add a parameter description
body Required TODO: Add a parameter description
contentType Optional TODO: Add a parameter description
cacheControl Optional TODO: 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 Code Error Description
400 400 Request is malformed or invalid
401 401 The specified user does not have access to the account
403 403 The user does not have access to this API
404 404 Path not found
415 415 The content-type of the request is incorrect
429 429 The rate limit has been reached

Method: deleteMedia

deleteMedia

function deleteMedia(userId, mediaId, callback)

Parameters

Parameter Tags Description
userId Required TODO: Add a parameter description
mediaId Required TODO: Add a parameter description

Example Usage


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

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

    
    });

Errors

Error Code Error Description
400 400 Request is malformed or invalid
401 401 The specified user does not have access to the account
403 403 The user does not have access to this API
404 404 Path not found
415 415 The content-type of the request is incorrect
429 429 The rate limit has been reached

Back to List of Controllers

Current Tags

  • 2.0.0                                ...           latest (2 months ago)

5 Versions

  • 2.0.0                                ...           2 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           6 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 5
Last Month 10
Dependencies (3)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |