Expand description
Official Rust SDK for the wi-api WhatsApp platform.
§Quick start
use wi_api::{Wi, types::SendTextParams};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let wi = Wi::new("YOUR_API_KEY");
let session = wi.session("my-instance");
let msg = session.send_text(SendTextParams {
to: "5511999999999".into(),
text: "Hello from wi-api".into(),
..Default::default()
}).await?;
println!("sent: {}", msg.message_id);
Ok(())
}Re-exports§
Modules§
Structs§
- Wi
- The wi-api client. Create with
Wi::neworWi::builder. - WiBuilder
- Builder for
Wi.