whatsapp-cloud-api
Whatsapp Cloud API Rust Client
Features
- Sending messages using Whatspp Cloud API
- Get / Upload media
- Models to help processing incoming webhooks
Usage example
Send template based text message
let access_token = "<access_token>";
let phone_number_id = "<phone_number_id>";
let to = "<to>";
let template_name = "hello_world";
let language = "en_US";
let template = new;
let message = from_template;
let client = new;
client.send_message.await?;
Send template based text message with parameters
let access_token = "<access_token>";
let phone_number_id = "<phone_number_id>";
let template_name = "sample_shipping_confirmation";
let language = "en_US";
let parameters = Vec from;
let components = Vec from;
let template = with_components;
let message = from_template;
let client = new;
let response = client.send_message.await?;
Send text message (Note: This requires an user initial conversation)
let access_token = "<access_token>";
let phone_number_id = "<phone_number_id>";
let to = "<to>";
let text = new;
let message = from_text;
let client = new;
client.send_message.await?;
For more details, please see the tests folder