termii-rust

Crates.iotermii-rust
lib.rstermii-rust
version0.1.1
sourcesrc
created_at2022-06-01 14:26:31.041882
updated_at2022-06-01 18:03:12.287196
descriptionRust SDK for termii a messaging provider.
homepagehttps://github.com/shepherd1530/termii-rust
repositoryhttps://github.com/shepherd1530/termii-rust
max_upload_size
id598238
size114,109
Sam (realsama)

documentation

https://docs.rs/termii-rust/

README

Termii Rust

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

Example

Sending a quick message

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);
Commit count: 2

cargo fmt