The official Rust SDK for Mslm APIs.
Install Rust and Cargo by following these instructions.
Mslm's APIs require an API key. If you don't have one, please read Authentication to understand how to get an API key before continuing.
Add the following to your Cargo.toml file:
[dependencies]
mslm = "1.0.0"
Reference the mslm
crate in your program and write some code.
Make sure to initialize the Client with your API key and handle the result accordingly.
use mslm::Client;
#[tokio::main]
async fn main() {
let c = Client::init("YOUR_API_KEY");
let res = c.email_verify.single_verify("[email protected]", None).await;
match res {
Ok(response) => {
println!("Response:\n{:#?}", response);
}
Err(err) => {
eprintln!("Error verifying email: {:#?}", err);
}
}
}
Subclienst can be initiated directly:
use mslm::Client;
use mslm::otp::OtpSendReq;
#[tokio::main]
async fn main() {
let c = Client::init("");
let mut otp = c.otp;
otp.set_api_key("YOUR_OTP_API_KEY");
let otp_send_req = OtpSendReq {
phone: String::from("<>"),
tmpl_sms: String::from("<>"),
token_len: 6,
expire_seconds: 60,
};
let res = otp.send(&otp_send_req, None).await;
match res {
Ok(response) => {
println!("Response:\n{:#?}", response);
}
Err(err) => {
eprintln!("Error: {:#?}", err);
}
}
}
See the official API Reference Documentation for details on each API's actual interface, which is implemented by this SDK.
See CONTRIBUTING for more information.
See Security Issue Notifications for more information.
This project is licensed under the MIT License.
At Mslm, we're all about making things better. Where others see norm, we see opportunity.
We build world-class solutions to the toughest problems. Excellence is a core value that defines our approach from top to bottom.
We're all about creating positive value for ourselves, our partners and our societies.
We do it by focusing on quality and the long-term, while intelligently maneuvering the complex realities of day-to-day business.
Our partners share our perspective, and we jointly produce truly world-class solutions to the toughest problems.