Crates.io | termii-rust |
lib.rs | termii-rust |
version | 0.1.1 |
source | src |
created_at | 2022-06-01 14:26:31.041882 |
updated_at | 2022-06-01 18:03:12.287196 |
description | Rust SDK for termii a messaging provider. |
homepage | https://github.com/shepherd1530/termii-rust |
repository | https://github.com/shepherd1530/termii-rust |
max_upload_size | |
id | 598238 |
size | 114,109 |
This is a Rust SDK for Termii's messaging api. The
Send a message
Send a one time token
Verify a one time token
Get your messaging history
Verify a phone number
Detects fake or ported numbers
Request a sender ID and many more termii features
This crate asynchronous client is the default client enabled by the default feature.
[dependencies]
termii_rust = { version = "0.1", features = ["default"] }
use termii_rust::{
async_impl::rest::termii,
common::switch::messaging::{Channel, MessageRequest, MessageType},
};
let client = termii::Termii::new("Your API key");
let _message = MessageRequest::new(
"234XXXXXXXXXX".to_string(),
"FromYourOrg".to_string(),
"Hello from Rust Termii. 😎".to_string(),
MessageType::Plain,
Channel::Dnd,
);
let message = client.switch.messaging.send(_message).await;
println!("{:?}", message);
The blocking client is also available, and can be enabled by the blocking
feature.
[dependencies]
termii_rust = { version = "0.1", features = ["blocking"] }
use termii_rust::{
blocking::rest::termii,
common::switch::messaging::{Channel, MessageRequest, MessageType},
}
let client = termii::Termii::new("Your API key");
let _message = MessageRequest::new(
"234XXXXXXXXXX".to_string(),
"FromYourOrg".to_string(),
"Hello from Rust Termii. 😎".to_string(),
MessageType::Plain,
Channel::Dnd,
);
let message = client.switch.messaging.send(_message).unwrap();
println!("{:?}", message);