pub async fn me(
client: &mut BoxClient<'_>,
fields: Option<Vec<String>>,
) -> Result<UserFull, BoxAPIError>Expand description
Retrieves information about the user who is currently authenticated.
In the case of a client-side authenticated OAuth 2.0 application this will be the user who authorized the app.
In the case of a JWT, server-side authenticated application this will be the service account that belongs to the application by default.
Use the As-User header to change who this API call is made on behalf of.
Sample usage:
use rusty_box::{Config, DevAuth, BoxClient,BoxAPIError, users_api};
use dotenv;
use std::env;
#[tokio::main]
async fn main() -> Result<(), BoxAPIError> {
dotenv::from_filename(".dev.env").ok();
let access_token = env::var("DEVELOPER_TOKEN").expect("DEVELOPER_TOKEN must be set");
let config = Config::new();
let auth = DevAuth::new(
config,
access_token,
);
let mut client = BoxClient::new(Box::new(auth));
let me = users_api::me(&mut client, None).await?;
println!("Me:{:#?}", me);
Ok(())
}