# aspsms

> Send SMS text messages through aspsms.com

Latest version **0.1.1** (published 2011-05-01) · 0 weekly downloads

## Install

```sh
npm install aspsms
pnpm add aspsms
yarn add aspsms
bun add aspsms
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2011-05-01 |
| First published | 2011-05-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Max Kueng |
| Keywords | sms, text message, short message service, aspsms |

## Links

- npm: https://www.npmjs.com/package/aspsms
- Repository: https://github.com/maxkueng/node-aspsms
- Homepage: http://maxkueng.com/node-aspsms
- npm.io page: https://npm.io/package/aspsms

## Dependencies (1)

- [request](https://npm.io/package/request.md) >=1.9.0

## Recent versions

- 0.1.1 (latest) — 2011-05-01
- 0.1.0 — 2011-05-01

## README

node-aspsms
===========

A partial implementation of the [aspsms.com][aspsms] XML SMS API for
[node.js][node]. 

Installation
------------

    sudo npm install aspsms

Methods
-------

 - `setDefaultOptions(options)` Sets the default options
 - `send(options, callback, message)` Sends a text message
 - `showCredits(options, callback, message)` Returns the amount of credits left

Options
-------

 - `userkey` Your ASPSMS Uesrkey
 - `password` Your ASPSMS password
 - `originator` Name of the sender
 - `recipient` Mobile phone number of the recipient

Errors
------

If the operation was successfull the `error` object passed to the callback will
be `null`. If the operation fails the error object will contain an `errorCode`
and an `errorDescription` field with values according to the aspsms.com
[documentation][aspsmsdoc].

Examples
--------

Send a text message

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : 'YOUR_ASPSMS_PASSWORD', 
	'originator' : 'TestApp'
});

aspsms.send({
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```

Show how many credits you have left

```javascript
var aspsms = require('aspsms');

aspsms.setDefaultOptions({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : 'YOUR_ASPSMS_PASSWORD', 
});

aspsms.showCredits({ }, function (error, credits) {
	if (!error) {
		console.log('You have ' + credits + ' left');
	}
	
});
```
If you don't want to use `setDefaultOptions` you can pass all options in each
command.

```javascript
var aspsms = require('aspsms');

aspsms.send({
	'userkey' : 'YOUR_ASPSMS_USERKEY', 
	'password' : 'YOUR_ASPSMS_PASSWORD', 
	'originator' : 'TestApp', 
	'recipient' : '+41555123456'

}, function (error) {
	if (!error) {
		console.log('Success!');
	}
	
}, 'Hello, this is a test.');
```


[aspsms]: http://www.aspsms.com/
[aspsmsdoc]: http://aspsms.com/xml/doc/xmlsvr191.pdf
[node]: http://nodejs.org/

---
_Source: https://npm.io/package/aspsms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
