whispir-sdk

Node.js SDK for Whispir's Powerful Conversation API.

whispir-sdk

Node.js based SDK for Whispir's Powerful Conversation Platform.

Deliver communications to your users, team members, customers, stakeholders or staff members via simple node.js commands.

Powered by Whispir.io.

Getting Started

You'll need to sign up for an account at whispir.io. This will give you your username, password and apikey.

Create a file in your home directory:

mkdir ~/.whispir
touch ~/.whispir/auth.json

The auth.json file should look as follows:

{
  "username":"john.smith",
  "password":"one2three",
  "apikey":"ds0dsf09hdfsh90df90hdfsj"
}

The whispir-sdk looks in your home directory for these properties so without them set it won't be able to connect to the api.

Install the module with: npm install whispir-sdk

var whispir_sdk = require('whispir-sdk');
var client = new whispir_sdk.Client(); //the client facilitates the requests.

var options = {};
var message = new whispir_sdk.Message();

message.setTo("+18888888888"); //no dashes please
message.setSubject("This is a subject");
message.setBody("This is a body");

client.sendMessage(message, options, function(statusCode, location) {
  console.log(statusCode); //should be 202
  console.log(location); //URL to the message
});

//easy peasy

Documentation

(Coming soon)

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2015 Jordan Walsh
Licensed under the MIT license.

HomePage

https://bitbucket.org/jordanwalsh23/whispir-sdk-node

Repository

git+ssh://git@bitbucket.org/jordanwalsh23/whispir-sdk-node.git


相关推荐