pub async fn id(
client: &mut BoxClient<'_>,
user_id: &str,
fields: Option<Vec<String>>,
) -> Result<UserFull, BoxAPIError>Expand description
Retrieves information about a user in the enterprise.
The application and the authenticated user need to have the permission to look up users in the entire enterprise.
This endpoint also returns a limited set of information for external users who are collaborated on content owned by the enterprise for authenticated users with the right scopes.
In this case, disallowed fields will return null instead.
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 user_id = "123";
let user = users_api::id(&mut client, &user_id, None).await?;
println!("User:{:#?}", user);
Ok(())
}