0.1.4 • Published 5 years ago

globelabs-sms-api v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

globelabs-sms-api

PayPal Ask me anything Version Downloads Get help on Codementor

GlobeLabs SMS API wrapper for Node.js

The GlobeLabs SMS API Reference is a good resource to learn more about these APIs.

:cloud: Installation

# Using npm
npm install --save globelabs-sms-api

# Using yarn
yarn add globelabs-sms-api

:clipboard: Example

const GlobeLabsSMS = require("../lib");

var client = new GlobeLabsSMS({
    senderAddress: process.env.SENDER_ADDRESS
    // This is optional
  , version: 'v1'
  , host: process.env.HOST || "https://devapi.globelabs.com.ph/"
});

client.sendMessage(
    {
        //required if consent workflow is enabled in account
        access_token: '3YM8xurK_IPdhvX4OUWXQljcHTIPgQDdTESLXDIes4g'
    },
    {
        "outboundSMSMessageRequest": {
           "clientCorrelator": "123456",
           "senderAddress": "1234",
           "outboundSMSTextMessage": {"message": "Hello World"},
           "address": "9171234567"
         }
    }, (err, data) => {
    console.log(err || data);
    // =>
    // {
    // "outboundSMSMessageRequest": {
    //   "address": "tel:+639175595283",
    //   "deliveryInfoList": {
    //     "deliveryInfo": [],
    //     "resourceURL": "https://devapi.globelabs.com.ph/smsmessaging/v1/outbound/8011/requests?access_token=3YM8xurK_IPdhvX4OUWXQljcHTIPgQDdTESLXDIes4g"
    //   },
    //   "senderAddress": "8011",
    //   "outboundSMSTextMessage": {
    //     "message": "Hello World"
    //   },
    //   "receiptRequest": {
    //     "notifyURL": "http://test-sms1.herokuapp.com/callback",
    //     "callbackData": null,
    //     "senderName": null,
    //     "resourceURL": "https://devapi.globelabs.com.ph/smsmessaging/v1/outbound/8011/requests?access_token=3YM8xurK_IPdhvX4OUWXQljcHTIPgQDdTESLXDIes4g"
    //   }
    // }
    //}
});

:question: Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. :bug:

  3. For direct and quick help, you can use Codementor. :rocket:

:memo: Documentation

You can see below the API reference of this module.

GlobeLabsSMS(options)

Creates the instance of the GlobeLabsSMS class.

Params

  • Object options: An object containing:
  • senderAddress (String): Refers to the application short code suffix (last 4 digits) (mandatory).
  • version (String): GlobeLabsSMS api version appended to host. (default: v1).
  • host (String): GlobeLabsSMS api host (default: https://devapi.globelabs.com.ph/).

sendMessage(params, data, cb)

Send an SMS message to one or more mobile terminals

Params

  • Object data: The Sending Messages body (documented here).
  • Object params: The Sending Messages parameters (documented here).
  • Function cb: The callback function.

:yum: How to contribute

Have an idea? Found a bug? See how to contribute.

:sparkling_heart: Support my projects

I do web services and open-source my used projects as much as I can. I will try to reply to everyone needing help using these projects. It consumes a lot of time and hardwork. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • PayPal—You can make one-time donations via PayPal. I'll probably buy a coffee tea. :tea:
  • Support me on Patreon—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
  • Bitcoin—You can send me bitcoins at this address (or scanning the code below): 344FWmvxDt6FFFoYoFjftiT3gGus68AqNw

    npm.io

Thank you! :heart:

:scroll: License

MIT

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago