Crate wacloudapi

Crate wacloudapi 

Source
Expand description

§WhatsApp Cloud API SDK for Rust

A Rust SDK for the WhatsApp Cloud API hosted by Meta. This library provides a type-safe, async interface for integrating WhatsApp Business messaging into your Rust applications.

§Features

  • Messages: Send text, media, templates, interactive messages, and more
  • Media: Upload, download, and manage media files
  • Templates: Work with message templates
  • Phone Numbers: Manage business phone numbers
  • Products: Catalog and product messages
  • Flows: WhatsApp Flows support
  • Analytics: Conversation and template analytics
  • QR Codes: Generate and manage QR codes
  • Block Users: Block/unblock users
  • WABA Management: WhatsApp Business Account management
  • Webhooks: Type-safe webhook payload parsing and subscription management

§Quick Start

use whatsapp_cloud_api::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new("YOUR_ACCESS_TOKEN", "YOUR_PHONE_NUMBER_ID");

    // Send a text message
    let response = client
        .messages()
        .send_text("628123456789", "Hello from Rust!")
        .await?;

    println!("Message sent: {:?}", response.messages[0].id);
    Ok(())
}

Re-exports§

pub use client::Client;
pub use error::Error;
pub use error::Result;

Modules§

analytics
Analytics API for WhatsApp Business
block
Block Users API for WhatsApp Business
client
HTTP client for the WhatsApp Cloud API
error
Error types for the WhatsApp Cloud API SDK
flows
Flows API for WhatsApp Flows
media
Media API for uploading and managing media files
messages
Messages API for sending WhatsApp messages
phone_numbers
Phone Numbers API for managing business phone numbers
products
Products and Catalog Messages API
qr_codes
QR Codes API for WhatsApp Business
templates
Templates API for managing message templates
types
Common types used across the WhatsApp Cloud API SDK
typing
Typing Indicators API
waba
WhatsApp Business Account (WABA) Management API
webhooks
Webhook types for receiving WhatsApp events
webhooks_management
Webhook Subscriptions Management API