Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04]
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
node-version: ['12', '14', '16']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down
124 changes: 62 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
# Bandwidth Node Messaging SDK

[![Test](https://github.com/Bandwidth/node-messaging/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/node-messaging/actions/workflows/test.yml)

| **OS** | **Node** |
|:---:|:---:|
| Windows 2016 | 12, 14, 16 |
| Windows 2019 | 12, 14, 16 |
| Ubuntu 18.04 | 12, 14, 16 |
| Ubuntu 20.04 | 12, 14, 16 |

Note: As of version 3.0.0, this package has been upgraded to TypeScript

## Getting Started

### Installation

```
npm install @bandwidth/messaging
```

### Initialize

```js
import { Client, ApiController, MessageRequest } from '@bandwidth/messaging';
const client = new Client({
basicAuthUserName: "username",
basicAuthPassword: "password"
});

const controller = new ApiController(client);
const accountId = "12345";
```

### Send A Text Message
```js
const applicationId = "3-a-b-c";
const toPhoneNumber = "+15554443333";
const fromPhoneNumber = "+15553334444";
const text = "Hello world";
const body = {
applicationId: applicationId,
to: [toPhoneNumber],
from: fromPhoneNumber,
text: text
};

const createMessageResponse = await controller.createMessage(accountId, body);
console.log(createMessageResponse.result.id);
```

## Supported Node Versions

This package can be used with Node >= 10

## Documentation

Documentation for this package can be found at https://dev.bandwidth.com/sdks/node.html

## Credentials

Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html
# Bandwidth Node Messaging SDK
[![Test](https://github.com/Bandwidth/node-messaging/actions/workflows/test.yml/badge.svg)](https://github.com/Bandwidth/node-messaging/actions/workflows/test.yml)
| **OS** | **Node** |
|:---:|:---:|
| Windows 2016 | 12, 14, 16 |
| Windows 2019 | 12, 14, 16 |
| Ubuntu 20.04 | 12, 14, 16 |
| Ubuntu 22.04 | 12, 14, 16 |
Note: As of version 3.0.0, this package has been upgraded to TypeScript
## Getting Started
### Installation
```
npm install @bandwidth/messaging
```
### Initialize
```js
import { Client, ApiController, MessageRequest } from '@bandwidth/messaging';
const client = new Client({
basicAuthUserName: "username",
basicAuthPassword: "password"
});
const controller = new ApiController(client);
const accountId = "12345";
```
### Send A Text Message
```js
const applicationId = "3-a-b-c";
const toPhoneNumber = "+15554443333";
const fromPhoneNumber = "+15553334444";
const text = "Hello world";
const body = {
applicationId: applicationId,
to: [toPhoneNumber],
from: fromPhoneNumber,
text: text
};
const createMessageResponse = await controller.createMessage(accountId, body);
console.log(createMessageResponse.result.id);
```
## Supported Node Versions
This package can be used with Node >= 10
## Documentation
Documentation for this package can be found at https://dev.bandwidth.com/sdks/node.html
## Credentials
Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html