rte-france-rs/examples/token.rs
Frank Villaro-Dixon 667713b575 init repo
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-10-27 20:03:50 +01:00

13 lines
448 B
Rust

use rte_france::RteApi;
fn main() {
let client_id = std::env::var("CLIENT_ID").expect("CLIENT_ID must be set");
let client_secret = std::env::var("CLIENT_SECRET").expect("CLIENT_SECRET must be set");
let mut rte_api = RteApi::new(client_id, client_secret);
println!("rte_api: {:?}", rte_api);
rte_api.authenticate().expect("Failed to authenticate");
let token = rte_api.get_token();
println!("token: {:?}", token);
}