📱 SMSGate Rust Client
An async-first Rust client for the SMSGate API: send and track SMS messages through your Android devices with full type safety, JWT or Basic authentication, and optional encryption. Built on tokio, reqwest, and serde with rustls by default. See the client libraries overview for the full ecosystem.
📖 About
android-sms-gateway is a typed Rust crate for the SMSGate 3rd-party API. It covers messages, inbox, devices, settings, webhooks, health, logs, and the JWT token lifecycle with comprehensive client-side validation, plus webhook payload signature verification (HMAC-SHA256) and optional end-to-end encryption (AES-256-CBC + PBKDF2) behind feature flags. Async-only with tokio.
📚 Table of Contents
⭐ Features
- Async-first with
tokioandreqwest - Basic and JWT authentication; token generate, refresh, and revoke
- Full API coverage: messages, inbox, devices, settings, webhooks, health, logs
- Webhook payload signature verification (HMAC-SHA256)
- End-to-end encryption (AES-256-CBC + PBKDF2) behind the
encryptionfeature rustlsTLS by default, no OpenSSL dependency (native-tlsfeature available)- Comprehensive client-side validation and typed domain models
📦 Installation
Optional: cargo add android-sms-gateway --features encryption to enable message encryption. TLS backend defaults to rustls-tls; switch with the native-tls feature.
🔑 Authentication
Two methods are supported: Basic authentication with account credentials, and JWT bearer tokens with scoped permissions. JWT is recommended for production.
Basic Authentication
let client = new?;
JWT Authentication
use ;
// Create a client with Basic auth to generate a token
let client = new?;
let token = client.generate_token.await?;
// Use the generated token for subsequent requests
let jwt_client = new?;
🚀 Quickstart
use ;
async
💻 Usage
Beyond sending, the client covers message listing and cancellation, inbox listing and refresh, device management, settings, webhooks, logs, and the token lifecycle. See src/client.rs for the complete method list with signatures and src/types for the domain models. Webhook signature verification lives in src/webhook.rs, encryption in src/encryption.rs.
📖 API Reference
- Official API Reference - endpoints, payloads, and error codes
- Authentication Guide - scopes and token management
- Client libraries overview
- Client source - full method reference and examples
🤝 Contributing
Contributions are welcome. Open an issue to discuss major changes before submitting a pull request; PRs target the master branch.
📄 License
Distributed under the Apache License 2.0. See LICENSE.