#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

#1560 in Web programming

Download history 5/week @ 2024-07-24 125/week @ 2024-07-31 4/week @ 2024-08-07 1/week @ 2024-08-14 125/week @ 2024-08-21 42/week @ 2024-08-28 13/week @ 2024-09-11 140/week @ 2024-09-18 33/week @ 2024-09-25 15/week @ 2024-10-02

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–29MB
~404K SLoC