https://github.com/rwxbytes/rusty_twilio
https://github.com/rwxbytes/rusty_twilio
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rwxbytes/rusty_twilio
- Owner: rwxbytes
- Created: 2025-02-08T17:29:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-04T23:29:47.000Z (about 1 year ago)
- Last Synced: 2025-09-29T09:48:09.671Z (8 months ago)
- Language: Rust
- Size: 96.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Contributing
Contributions are welcome.
### Create Call
```rust
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(())
}
```