netgsm-sms-sender
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

NetGSM SMS Service NPM Package

This package is a Node.js module for sending SMS using NetGSM.

Installation

You can add the package to your project using npm or yarn.

npm install netgsm-sms-service

or

yarn add netgsm-sms-service

Usage

import { SMSService, NetGsmConfiguration, SendSmsRequest } from "netgsm-sms-service";

// Define your NetGSM account details
const netGsmConfig: NetGsmConfiguration = {
  usercode: "YOUR_NETGSM_USERCODE",
  password: "YOUR_NETGSM_PASSWORD",
  msgheader: "YOUR_NETGSM_MSGHEADER"
};

// Create an SMS service
const smsService = new NetGsmSMSService(netGsmConfig);

// Create an SMS send request
const smsRequest: SendSmsRequest = {
  gsmno: "RECIPIENT_PHONE_NUMBER",
  message: "YOUR_SMS_MESSAGE",
  dil: "TR" 
};

// Send the SMS
smsService.sendSMS(smsRequest);

API Reference

SMSService Class

Constructor

constructor(netGsmConfiguration: NetGsmConfiguration)

Creates an instance of SMSService with the provided NetGSM account details.

Methods

sendSMS(request: SendSmsRequest): void

Performs the specified SMS send request.

Interfaces

NetGsmConfiguration

interface NetGsmConfiguration {
  usercode: string;
  password: string;
  msgheader: string;
}

An interface representing NetGSM account details.

SendSmsRequest

interface SendSmsRequest {
  gsmno: string;
  message: string;
  startdate?: string;
  stopDate?: string;
  dil: string;
  filter?: string;
  bayikodu?: string;
  appkey?: string;
}

An interface representing an SMS send request.

License

This project is licensed under the ISC License - see the LICENSE.md file for details.

Readme

Keywords

none

Package Sidebar

Install

npm i netgsm-sms-sender

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

8.57 kB

Total Files

7

Last publish

Collaborators

  • ahmetmel