Socket
Socket
Sign inDemoInstall

@appsolutely/gatewayapi

Package Overview
Dependencies
6
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @appsolutely/gatewayapi

Node Gatewayapi SMS API wrapper


Version published
Weekly downloads
7
increased by75%
Maintainers
2
Install size
7.47 MB
Created
Weekly downloads
 

Readme

Source

@appsolutely/gatewayapi

Node library for Gatewayapi.com

For documentation of the API, see Gatewayapi.com

This is not gatewayapi's official node library.

Installation


npm install @appsolutely/gatewayapi

Loading and configuring the module


// CommonJS
const gatewayapi = require('@appsolutely/gatewayapi');
gatewayapi.setApiToken('YOUR GATEWAYAPI TOKEN')

// ES Module
import * as gatewayapi from '@appsolutely/gatewayapi';
gatewayapi.setApiToken('YOUR GATEWAYAPI TOKEN')

Send SMS

const payload: gatewayapi.payloadObject = {
        sender: 'exampleSender',
        message: "Example message string to %FIRSTNAME% %LASTNAME%",
        callback_url: 'https://api.example.com/callback',
        userref: '123abc',
        tags: ['%FIRSTNAME%', '%LASTNAME%'],
        recipients: [
            {
                msisdn: 4712345678,
                tagvalues: ['Barack', 'Obama']
            },
        ],
}

gatewayapi.sendSMS(payload).then(response => {
    //Do something with the response
}).catch(error => {
    //Do something with the error
})

Check balance

gatewayapi.checkBalance(payload).then(response => {
    //Do something with the response
}).catch(error => {
    //Do something with the error
})

Keywords

FAQs

Last updated on 18 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc