#twilio #http-request #api-client #api-access #api #rust

twilly

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

8 releases

0.2.1 Sep 19, 2024
0.2.0 Aug 26, 2024
0.1.1 Aug 1, 2024
0.1.0 Apr 5, 2024
0.0.2 Feb 5, 2024

#1570 in Web programming

Download history 2/week @ 2024-08-10 147/week @ 2024-08-24 20/week @ 2024-08-31 125/week @ 2024-09-14 42/week @ 2024-09-21 32/week @ 2024-09-28 2/week @ 2024-10-05

414 downloads per month
Used in twilly_cli

MIT license

98KB
2K SLoC

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.


lib.rs:

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);

Dependencies

~9–25MB
~398K SLoC