0.0.1 • Published 2 years ago

letesend v0.0.1

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

Letesend

This is a nodejs package for sending and monitoring SMS with letesend. Letesend is a sms gateway that tries to make sms price cheaper, more information at letesend.com.

Installation

Install using npm with :

npm install letesend

Example Usage

Go to letesend.com/console and copy your auth token. After installing, import letesend into your program and replace your auth token, see the code below.

import SMS from "letesend"

const AUTH_TOKEN  = "Replace_Your_Auth_Token_Here"
const sms         = new SMS(AUTH_TOKEN)

let to            = "+243*********"
let name          = "Company"
let body          = "Hello World !"

await sms.send(to, name, body)

if(sms.ok){
    console.log('SMS processed successfully')
}

console.log(sms.status_code, sms.status_text)

Output

SMS processed successfully
201 {
    "id":5,
    "to":"+243*********",
    "name":"Company",
    "body":"Hello World !",
    "status":"0",
    "date":"2022-03-05",
    "time":"11:57:28.357820"
}

Troubleshoot

403 {
    "detail": "Your balance (0.0$) is insufficient to send 1 SMS."
}

It means you don't have enough money in your account For sending the SMS.

400 {
    "to": ["The phone number entered is not valid."]
}

The phone number must be a E.164 format.

Class Description

The SMS class description provides methods and attributes for sending and monitoring SMS.

Methods

Send

Send sms with letesend gateway.

ParametersTypeDescription
toStringThe receiver phone number (E.164 format)
nameStringThe name (will be displayed in the SMS header)
bodyStrimgThe sms body (the message)

attributes

NameTypeDescription
idNumberThe unique sms indetification
toStringThe receiver phone number (E.164 format)
nameStringThe name (will be displayed in the SMS header)
bodyStringThe sms body (the message)
statusStringThe SMS status 0 : Processed 1 : Sent 2 : Queued 3 : Scheduled 4 : Undelivered 5 : Delivered 6 : Delivery_unknown 7 : Failed
dateStringThe date the request was sent to our server
timeStringThe time the request was sent to our server
status_codeStringThe http response status 201 : The SMS has successfully Processed 403 : Can not send SMS for some reasons 400 : Bad Request
status_textStringThe http response details
okBooleanSMS processed successfully
auth_tokenStringThe Authentication token.

More information at letesend.com or contact us at support@letesend.com