Crates.io | authy-rs |
lib.rs | authy-rs |
version | 0.1.0 |
source | src |
created_at | 2018-12-06 22:40:20.554295 |
updated_at | 2018-12-06 22:40:20.554295 |
description | A API client for the Twilio Authy REST API. |
homepage | |
repository | https://github.com/jgraef/authy-rs |
max_upload_size | |
id | 100468 |
size | 9,733 |
Rust client for the Authy API by Twilio.
Disclaimer: This crate is not an official Twilio product.
use twilio::authy::{Client, Via};
use phonenumber::PhoneNumber;
let client = Client::new("<AUTHY API KEY>");
let verify_response = client.verify("TEST PHONE NUMBER", Via::SMS, 6, "en").expect("verify failed");
let status_response = client.status(verify_response.uuid.into()).expect("status failed");
println!("Status:\n{:#?}", status_response);
// The verification code received as SMS
let code: u32 = 123456;
let check_response = client.check("TEST PHONE NUMBER", code).expect("check failed");
if check_response.success {
println!("Phone number verified!");
}
else {
println!("Verification failed");
}