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 letesend.com.
Installation
Install using pip with :
pip 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.
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 processed 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
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
| 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. |
More information at letesend.com or contact us at support@letesend.com
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
File details
Details for the file letesend-0.4.tar.gz.
File metadata
- Download URL: letesend-0.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312401435e2c3dc7436ff95c979f7b8d5469710f950c001c8d9e10c67f15181f
|
|
| MD5 |
8421e5b5d8d78b842aa56d82caae1611
|
|
| BLAKE2b-256 |
9b85ad54d39900a54a5a305607d51a5af042fd694fea70c66e153a6dfef85ac5
|