#twilio #reqwest #api #rust

twilly

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

5 releases

0.1.0 Apr 5, 2024
0.0.4 Mar 26, 2024
0.0.3 Mar 9, 2024
0.0.2 Feb 5, 2024
0.0.1 Feb 5, 2024

#880 in Authentication

Download history 8/week @ 2024-02-02 4/week @ 2024-02-16 16/week @ 2024-02-23 7/week @ 2024-03-01 145/week @ 2024-03-08 7/week @ 2024-03-15 65/week @ 2024-03-22 24/week @ 2024-03-29 114/week @ 2024-04-05

212 downloads per month
Used in twilly_cli

MIT license

74KB
1.5K 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–26MB
~420K SLoC