Thanks to visit codestin.com
Credit goes to lib.rs

#http-request #twilio #api #rust-api

twilly

A implementation of the Twilio API in Rust built upon Reqwest and Serde

9 releases

0.2.2 Feb 24, 2025
0.2.1 Sep 19, 2024
0.2.0 Aug 26, 2024
0.1.1 Aug 1, 2024
0.0.2 Feb 5, 2024

#864 in Web programming


Used in twilly_cli

MIT license

98KB
2K SLoC

This crate is an implementation of the Twilio API in Rust built upon Reqwest and Serde.

Coverage is partial yet provides an idiomatic usage pattern currently covering:

  • Accounts
  • Conversations
  • Sync (Documents, Lists, and Maps)

This crate has been developed alongside the `twilly-cli crate which provides an enhanced Twilio CLI experience.

Example

Interaction is done via a Twilio client that can be created via the constructor. The config parameter is a TwilioConfig struct of an account SID & auth token pair.

let twilio = twilly::Client::new(&config);

To retrieve accounts from the client:

twilio.accounts().list(Some(&friendly_name), None);

To delete a conversation:

twilio.conversations().delete(&conversation_sid);

twilly

twilly is a helper library bringing access to Twilio's API's via Rust. The library supports a client-based approach, instantiating a twilio client with credentials before sending & receiving requests.

let config =  TwilioConfig {
  account_sid: "AC....",
  auth_token: "auth_tok",
};
let twilio = twilly::Client::new(config);

...

let account = twilio.create_account(Some(&friendly_name))

Coverage is limited and the crate has been built alongside twilly_cli.

Dependencies

~9–27MB
~408K SLoC