public BoxClient UserClient(string userToken, string userId) { var userSession = this.Session(userToken); var authRepo = new JWTAuthRepository(userSession, this, userId); var userClient = new BoxClient(this.boxConfig, authRepo); return(userClient); }
public BoxClient AdminClient(string adminToken) { var adminSession = this.Session(adminToken); var authRepo = new JWTAuthRepository(adminSession, this); var adminClient = new BoxClient(this.boxConfig, authRepo); return(adminClient); }
/// <summary> /// Create admin BoxClient using an admin access token /// </summary> /// <param name="adminToken">Admin access token</param> /// <param name="asUser">The user ID to set as the 'As-User' header parameter; used to make calls in the context of a user using an admin token</param> /// <param name="suppressNotifications">Whether or not to suppress both email and webhook notifications. Typically used for administrative API calls. Your application must have “Manage an Enterprise” scope, and the user making the API calls is a co-admin with the correct "Edit settings for your company" permission.</param> /// <returns>BoxClient that uses JWT authentication</returns> public BoxClient AdminClient(string adminToken, string asUser = null, bool?suppressNotifications = null) { var adminSession = this.Session(adminToken); var authRepo = new JWTAuthRepository(adminSession, this); var adminClient = new BoxClient(this.boxConfig, authRepo, asUser: asUser, suppressNotifications: suppressNotifications); return(adminClient); }
/// <summary> /// Create user BoxClient by user access token /// </summary> /// <param name="userToken">User access token</param> /// <param name="userId">Id of the user</param> /// <returns>BoxClient that uses JWT authentication</returns> public BoxClient UserClient(string userToken, string userId) { var userSession = this.Session(userToken); var authRepo = new JWTAuthRepository(userSession, this, userId); var userClient = new BoxClient(this.boxConfig, authRepo); return userClient; }
/// <summary> /// Create admin BoxClient by admin access token /// </summary> /// <param name="adminToken">Admin access token</param> /// <param name="asUser">The user ID to set as the 'As-User' header parameter; used to make calls in the context of a user using an admin token</param> /// <param name="suppressNotifications">Whether or not to suppress both email and webhook notifications. Typically used for administrative API calls. Your application must have “Manage an Enterprise” scope, and the user making the API calls is a co-admin with the correct "Edit settings for your company" permission.</param> /// <returns>BoxClient that uses JWT authentication</returns> public BoxClient AdminClient(string adminToken, string asUser = null, bool? suppressNotifications = null) { var adminSession = this.Session(adminToken); var authRepo = new JWTAuthRepository(adminSession, this); var adminClient = new BoxClient(this.boxConfig, authRepo, asUser: asUser, suppressNotifications: suppressNotifications); return adminClient; }
public BoxClient AdminClient(string adminToken) { var adminSession = this.Session(adminToken); var authRepo = new JWTAuthRepository(adminSession, this); var adminClient = new BoxClient(this.boxConfig, authRepo); return adminClient; }