A professional, asynchronous Rust client library for the IPPANEL SMS web service. This crate provides a convenient and type-safe interface for sending SMS, managing patterns, checking credit, and more, making it easy to integrate IPPANEL SMS services into your Rust applications.
- Send single or bulk SMS messages
- Send pattern-based (templated) messages
- Fetch message statuses and details
- Create message patterns
- Retrieve account credit
- Fetch inbox messages
- Fully asynchronous
- Strongly typed models for all API responses
Add this to your Cargo.toml:
[dependencies]
ippanel-sms = "<latest-version>"Replace <latest-version> with the latest published version.
use ippanel_sms::IppanelClient;
#[tokio::main]
async fn main() {
let api_key = "your_api_key";
let client = IppanelClient::new(Some(api_key.to_string()), None);
let credit = client.get_credit().await.unwrap();
println!("Your credit: {}", credit);
}Integration tests are provided in tests/integration.rs. To run the tests:
The following environment variables must be set before running the tests:
IPPANEL_API_KEY– Your IPPANEL API keyIPPANEL_MOBILE_NUMBER– A recipient mobile number (for sending tests)IPPANEL_SENDER_NUMBER– Your sender number (for sending tests)IPPANEL_MESSAGE_ID– A valid message ID (for status and message fetch tests)IPPANEL_PATTERN_CODE– A valid pattern code (for pattern send tests)
- Set the required environment variables (see above).
- Run:
cargo test --test integrationNote:
- The tests interact with the real IPPANEL API and may send actual SMS messages. Use test numbers and patterns where possible.
- Ensure your API key and other sensitive data are kept secure.
This project is licensed under the MIT License.