npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sms-gateway24

v1.0.5

Published

API package smsgateway24.com

Downloads

2

Readme

SMS Service

Attention, before using you need to register on the site https://smsgateway24.com/ and follow the instructions on this site.

The SMS Service package provides a convenient way to send SMS messages and perform other operations using the SMS Gateway 24 API. It utilizes the Axios library for making HTTP requests and the FormData library for handling multipart/form-data requests.

Installation

To use this package in your project, you need to have Node.js installed. You can install the package via npm by running the following command:

npm install sms-gateway24

Usage

To use the SMS Service, follow the steps below:

  1. Create an instance of the SmsService class by providing your email and password received after registering on the site https://smsgateway24.com/:
const smsService = new SmsService('[email protected]', 'your-password');
  1. Initialize the service by calling the initialize method:
await smsService.initialize();
  1. You can now use the SMS Service methods to send SMS messages, add contacts, get device status, and perform other operations.

Sending an SMS

To send an SMS message, use the sendSMS method:

const phoneNumbers = '1234567890';
const message = 'Hello, World!';

try {
  const smsId = await smsService.sendSMS(phoneNumbers, message);
  console.log('SMS sent successfully. SMS ID:', smsId);
} catch (error) {
  console.error('Failed to send SMS:', error.message);
}

Adding a Contact with Tags

To add a contact with tags, use the addContactWithTags method:

const phone = '1234567890';
const tagId = 1;
const fullName = 'John Doe';

try {
  const contactId = await smsService.addContactWithTags(phone, tagId, fullName);
  console.log('Contact added successfully. Contact ID:', contactId);
} catch (error) {
  console.error('Failed to add contact with tags:', error.message);
}

Getting Device Status

To get the status of a device, use the getDeviceStatus method:

const deviceId = 123;

try {
  const { lastseen, device_id, title } = await smsService.getDeviceStatus(deviceId);
  console.log('Device Status:');
  console.log('Last Seen:', lastseen);
  console.log('Device ID:', device_id);
  console.log('Title:', title);
} catch (error) {
  console.error('Failed to get device status:', error.message);
}

Getting All Devices

To get information about all devices, use the getAllDevices method:

try {
  const devices = await smsService.getAllDevices();
  console.log('All Devices:', devices);
} catch (error) {
  console.error('Failed to get all devices:', error.message);
}

Getting SMS Status

To get the status of an SMS message, use the getSmsStatus method:

const smsId = 123;

try {
  const { smsId, status, statusDescription } = await smsService.getSmsStatus(smsId);
  console.log('SMS Status:');
  console.log('SMS ID:', smsId);
  console.log('Status:', status);
  console.log('Status Description:', statusDescription);
} catch (error) {
  console.error('Failed to get SMS status:', error.message);
}

These are just a few examples of how to use the SMS Service package. You can explore the available methods in the source code and refer to the SMS Gateway 24 API documentation for more information on the available endpoints and parameters.

License

This project is licensed under the MIT License.

FQA

For all questions, bugs and suggestions, please contact [email protected]