1.0.2 • Published 10 years ago

nimbow-client v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

Nimbow node.js Client

This is the official node.js client for the Nimbow API (http://www.nimbow.com).

You find the complete API documentation here: https://www.nimbow.com/sms-api/nimbow-api/

NPM-Package: https://www.npmjs.com/package/nimbow-client

Install

npm install nimbow-client

Usage

Simple SMS sending

var apiKey = "YOUR-API-KEY";
var protocol = "https"; // or http
var testMode = false; // optional; set to true if you want to send a test messages (no delivery, no cost, but visible in your portal)

require("nimbow-client")
	.create(apiKey, protocol, testMode)
	.sendTextMessage("Sender", "491771234567", "Hello World!");

Send flash SMS

var apiKey = "YOUR-API-KEY";
var protocol = "https"; // or http

require("nimbow-client")
	.create(apiKey, protocol)
	.sendTextMessage("Sender", "491771234567", "Hello World!", {Flash: true});

Set a client reference

var apiKey = "YOUR-API-KEY";
var protocol = "https"; // or http

require("nimbow-client")
	.create(apiKey, protocol)
	.sendTextMessage("Sender", "491771234567", "Hello World!", {ClientRef: "My Campaign"});
	
// in your Nimbow portal you can configure a DeliveryReport Callback URL; this will receive the ClientRef from above...

Unicode SMS sending

var apiKey = "YOUR-API-KEY";
var protocol = "https"; // or http

require("nimbow-client")
	.create(apiKey, protocol)
	.sendUnicodeTextMessage("Sender", "491771234567", "привет");

Inspect response

var apiKey = "YOUR-API-KEY";
var protocol = "https"; // or http

require("nimbow-client")
	.create(apiKey, protocol)
	.sendTextMessage(
		"Sender",
		"491771234567", 
		"Hello World!",
		{GetMessageId: true},
		function(error, apiResponse) {
			console.log("StatusCode: " + apiResponse.StatusCode + " MessageId: " + apiResponse.MessageId)
		}
	);