rusty_twilio

Crates.iorusty_twilio
lib.rsrusty_twilio
version0.1.1
created_at2025-04-04 23:25:41.685582+00
updated_at2025-04-04 23:30:36.334071+00
descriptionA Rust library for interacting with the Twilio API
homepage
repositoryhttps://github.com/rwxbytes/rusty_twilio
max_upload_size
id1621017
size170,476
(rwxbytes)

documentation

README

Contributing

Contributions are welcome.

Create Call

use rusty_twilio::endpoints::voice::call::{CreateCall, CreateCallBody};
use rusty_twilio::{Result, TwilioClient};

#[tokio::main]
async fn main() -> Result<()> {
    let client = TwilioClient::from_env()?;

    let body = CreateCallBody::new("to", "from", "http://demo.twilio.com/docs/voice.xml");

    // or to set other fields
    //let body = CreateCallBody {
    //    to: "to",
    //    from: "from",
    //    url: Some("http://demo.twilio.com/docs/voice.xml"),
    //    status_callback: Some("http://example.com/callback"),
    //    status_callback_event_initiated: Some(true),
    //    status_callback_event_answered: Some(true),
    //    ..Default::default()
    //};

    let endpoint = CreateCall::new(client.account_sid(), body);

    let resp = client.hit(endpoint).await?;

    println!("{:?}", resp);
    Ok(())
}
Commit count: 82

cargo fmt