Table of Contents
- Table of Contents
- About The Project
- Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
About The Project
A Rust client library for the SMSGate API. Send and receive SMS messages through your Android device with full type safety and async support.
Key features:
- Full API coverage: messages, devices, settings, webhooks, auth, inbox, logs
- Async-first with
tokio - End-to-end message encryption (AES-256-CBC + PBKDF2-SHA1)
- Webhook payload signature verification (HMAC-SHA256)
- JWT and HTTP Basic authentication
rustlsby default — no OpenSSL dependency- Comprehensive client-side validation
Built With
Getting Started
Prerequisites
- Rust 2021 edition (MSRV 1.75+)
- An SMSGate app and API credentials
Quick Start
-
Add the dependency to your
Cargo.toml:[] = "0.1" -
Create a client and send your first message:
use ; async
Usage
Feature Flags
| Feature | Description | Default |
|---|---|---|
rustls-tls |
Use rustls for TLS |
yes |
native-tls |
Use platform-native TLS | no |
encryption |
Enable AES-256-CBC encryption/decryption | no |
API Overview
| Method | Endpoint | Description |
|---|---|---|
check_health() |
GET /health |
Service health check |
send() |
POST /messages |
Send a text or data message |
list_messages() |
GET /messages |
List messages with filtering |
get_message_state() |
GET /messages/{id} |
Get message delivery status |
cancel_message() |
DELETE /messages/{id} |
Cancel a pending message |
list_devices() |
GET /devices |
List registered devices |
delete_device() |
DELETE /devices/{id} |
Remove a device |
get_settings() |
GET /settings |
Get device settings |
replace_settings() |
PUT /settings |
Replace all settings |
update_settings() |
PATCH /settings |
Partially update settings |
list_webhooks() |
GET /webhooks |
List registered webhooks |
register_webhook() |
POST /webhooks |
Register a new webhook |
delete_webhook() |
DELETE /webhooks/{id} |
Remove a webhook |
generate_token() |
POST /auth/token |
Create a JWT token |
refresh_token() |
POST /auth/token/refresh |
Refresh an existing token |
revoke_token() |
DELETE /auth/token/{jti} |
Revoke a token |
refresh_inbox() |
POST /inbox/refresh |
Pull new messages from device |
list_inbox_messages() |
GET /inbox |
List received messages |
get_logs() |
GET /logs |
Retrieve device logs |
export_inbox() |
POST /inbox/export |
Export messages via webhooks |
Webhook Verification
Verify incoming webhook payloads signed by the Android device:
use verify_signature;
let valid = verify_signature;
Encryption
Encrypt message fields before sending (AES-256-CBC + PBKDF2-SHA1):
= { = "0.1", = ["encryption"] }
use Encryptor;
let encryptor = new;
let encrypted = encryptor.encrypt;
let decrypted = encryptor.decrypt.unwrap;
For full API documentation, see docs.rs/android-sms-gateway.
Roadmap
- Core HTTP transport with error mapping
- All REST API endpoints (messages, devices, settings, webhooks, auth, inbox, logs)
- Domain types with Serde serialization and client-side validation
- Webhook payload signature verification (HMAC-SHA256)
- Message encryption (AES-256-CBC + PBKDF2-SHA1)
- Documentation and examples
- Blocking client (
blockingfeature) - Integration tests with wiremock
- Connection pooling and retry configuration
See the open issues for a full list of proposed features and known issues.
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the Apache License, Version 2.0. See LICENSE for more information.
Contact
Project Link: https://github.com/android-sms-gateway/client-rs
Acknowledgments
- othneildrew/Best-README-Template
- RustCrypto for the AES, CBC, PBKDF2, HMAC, and SHA crates
- reqwest HTTP client
- tokio async runtime
- serde serialization framework
- Shields.io for badges