Skip to main content

Letesend sdk for sending and monitoring SMS

Project description

Letesend Python

This is a python library for sending and monitoring SMS with letesend. Letesend is a sms gateway that tries to make sms price cheaper, more information at https://letesend.com/.

Installation

Install using pip with :

pip install letesend

Example Usage

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

from letesend import SMS

AUTH_TOKEN  = "Replace_Your_Auth_Token_Here"
sms         = SMS(AUTH_TOKEN)

sms.send(
    to      = "+243xxxxxxxxx",
    name    = "Company",
    body    = "Hello World !"
)

if sms.ok:
    print('SMS sent successfully')

print(sms.status_code, sms.status_text)

Output

SMS processed successfully
201 {
    "id":5,
    "to":"+243xxxxxxxxx",
    "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 a E.164 format.

Class Description

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

Methods

List of methods

Send

Send sms with letesend gateway.

Parameters Type Description
to String The receiver phone number (E.164 format)
name String The name (will be displayed in the SMS header)
body Strimg The sms body (the message)

attributes

List of attributes

Name Type Description
id Integer The unique sms indetification
to String The receiver phone number (E.164 format)
name String The name (will be displayed in the SMS header)
body String The sms body (the message)
status String The SMS status
0 : Processed
1 : Sent
2 : Queued
3 : Scheduled
4 : Undelivered
5 : Delivered
6 : Delivery_unknown
7 : Failed
date String The date the request was sent to our server
time String The time the request was sent to our server
status_code String The http response status
201 : The SMS has successfully Processed
403 : Can not send SMS for some reasons
400 : Bad Request
status_text String The http response details
ok Boolean SMS processed successfully
auth_token String The Authentication token.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

letesend-0.3.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file letesend-0.3.tar.gz.

File metadata

  • Download URL: letesend-0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.2

File hashes

Hashes for letesend-0.3.tar.gz
Algorithm Hash digest
SHA256 34b258642d2f1d7e0acf5955360df76a0175718ac4edd873e4936471a1e3db1d
MD5 2175f5967b67e4ccf0c8b86e79cc5581
BLAKE2b-256 69a86d21673124601cd1b0ffb0c74178f47db3ede9bd01858b946257562c1973

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page