Class: Enterprise

Enterprise(client) → {void}

Simple manager for interacting with all Enterprise endpoints and actions.

Constructor

new Enterprise(client) → {void}

Parameters:
Name Type Description
client BoxClient The Box API Client that is responsible for making calls to the API
Source:
Returns:
Type
void

Methods

addAppUser(name, optionsopt, callbackopt) → {Promise.<Object>}

Create a new app user in the current enterprise API Endpoint: '/users' Method: POST
Parameters:
Name Type Attributes Description
name string The name of this user
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Description
language string <optional>
The user's language
job_title string <optional>
The user’s job title
phone string <optional>
The user’s phone number
address string <optional>
The user’s address
space_amount int <optional>
The user’s total available storage space in bytes
timezone string <optional>
The user's timezone
callback function <optional>
Passed the created user if successful, error otherwise
Source:
Returns:
A promise resolving to the created user
Type
Promise.<Object>

addAppUser(name, optionsopt, callbackopt) → {Promise.<Object>}

Create a new app user in the current enterprise API Endpoint: '/users' Method: POST
Parameters:
Name Type Attributes Description
name string The name of this user
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Description
language string <optional>
The user's language
job_title string <optional>
The user’s job title
phone string <optional>
The user’s phone number
address string <optional>
The user’s address
space_amount int <optional>
The user’s total available storage space in bytes
timezone string <optional>
The user's timezone
callback function <optional>
Passed the created user if successful, error otherwise
Source:
Returns:
A promise resolving to the created user
Type
Promise.<Object>

addUser(login, name, optionsopt, callbackopt) → {Promise.<Object>}

Create a new user in the current enterprise API Endpoint: '/users' Method: POST
Parameters:
Name Type Attributes Description
login string The email address this user uses to login
name string The name of this user
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Description
role EnterpriseRole <optional>
This user’s enterprise role
language string <optional>
The user's language
is_sync_enabled boolean <optional>
Whether or not this user can use Box Sync
job_title string <optional>
The user’s job title
phone string <optional>
The user’s phone number
address string <optional>
The user’s address
space_amount int <optional>
The user’s total available storage space in bytes
tracking_codes Array <optional>
An array of key/value pairs set by the user’s admin
status EnterpriseUserStatus <optional>
The user's status
can_see_managed_users boolean <optional>
Whether the user should be able to see other managed users
timezone string <optional>
The user's timezone
is_exempt_from_device_limits boolean <optional>
Whether to exempt this user from Enterprise device limits
is_exempt_from_login_verification boolean <optional>
Whether or not this user must use two-factor authentication
is_external_collab_restricted boolean <optional>
Whether the user is allowed to collaborate with users outside their enterprise
callback function <optional>
Passed the created user if successful, error otherwise
Source:
Returns:
A promise resolving to the created user
Type
Promise.<Object>

addUser(login, name, optionsopt, callbackopt) → {Promise.<Object>}

Create a new user in the current enterprise API Endpoint: '/users' Method: POST
Parameters:
Name Type Attributes Description
login string The email address this user uses to login
name string The name of this user
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Description
role EnterpriseRole <optional>
This user’s enterprise role
language string <optional>
The user's language
is_sync_enabled boolean <optional>
Whether or not this user can use Box Sync
job_title string <optional>
The user’s job title
phone string <optional>
The user’s phone number
address string <optional>
The user’s address
space_amount int <optional>
The user’s total available storage space in bytes
tracking_codes Array <optional>
An array of key/value pairs set by the user’s admin
status EnterpriseUserStatus <optional>
The user's status
can_see_managed_users boolean <optional>
Whether the user should be able to see other managed users
timezone string <optional>
The user's timezone
is_exempt_from_device_limits boolean <optional>
Whether to exempt this user from Enterprise device limits
is_exempt_from_login_verification boolean <optional>
Whether or not this user must use two-factor authentication
is_external_collab_restricted boolean <optional>
Whether the user is allowed to collaborate with users outside their enterprise
callback function <optional>
Passed the created user if successful, error otherwise
Source:
Returns:
A promise resolving to the created user
Type
Promise.<Object>

getUsers(optionsopt, callbackopt) → {Promise.<Object>}

Get a list of users in the current enterprise API Endpoint: '/users' Method: GET
Parameters:
Name Type Attributes Description
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Default Description
filter_term string <optional>
Filter the results to only users starting with the filter_term in either the name or the login
limit int <optional>
100 The number of records to return
usemarker boolean <optional>
false Whether or not to use marker-based pagination
marker string <optional>
'' The marker for the page at which to start. Default is the first page
offset int <optional>
0 The record at which to start
user_type EnterpriseUserType <optional>
managed The type of user to search for
callback function <optional>
Passed the list of users if successful, error otherwise
Source:
Returns:
A promise resolving to the collection of users
Type
Promise.<Object>

getUsers(optionsopt, callbackopt) → {Promise.<Object>}

Get a list of users in the current enterprise API Endpoint: '/users' Method: GET
Parameters:
Name Type Attributes Description
options Object <optional>
Optional parameters, can be left null in most cases
Properties
Name Type Attributes Default Description
filter_term string <optional>
Filter the results to only users starting with the filter_term in either the name or the login
limit int <optional>
100 The number of records to return
usemarker boolean <optional>
false Whether or not to use marker-based pagination
marker string <optional>
'' The marker for the page at which to start. Default is the first page
offset int <optional>
0 The record at which to start
user_type EnterpriseUserType <optional>
managed The type of user to search for
callback function <optional>
Passed the list of users if successful, error otherwise
Source:
Returns:
A promise resolving to the collection of users
Type
Promise.<Object>

inviteUser(enterpriseID, email, callbackopt) → {Promise.<Object>}

Invites a user to join the enterprise API Endpoint: '/invites' Method: POST
Parameters:
Name Type Attributes Description
enterpriseID string The ID of the enterprise to invite the user to
email string The email address of the user to invite
callback function <optional>
Passed the invite object if successful, error otherwise
Source:
Returns:
A promise resolving to the invite object
Type
Promise.<Object>

inviteUser(enterpriseID, email, callbackopt) → {Promise.<Object>}

Invites a user to join the enterprise API Endpoint: '/invites' Method: POST
Parameters:
Name Type Attributes Description
enterpriseID string The ID of the enterprise to invite the user to
email string The email address of the user to invite
callback function <optional>
Passed the invite object if successful, error otherwise
Source:
Returns:
A promise resolving to the invite object
Type
Promise.<Object>

transferUserContent(sourceUserID, destUserID, callbackopt) → {Promise.<Object>}

Transfers all of a user's files into another user's account. API Endpoint: '/users/:sourceUserID/folders/0' Method: PUT
Parameters:
Name Type Attributes Description
sourceUserID string The ID of the user whose files will be transferred
destUserID string The ID of the user to transfer the files to
callback function <optional>
Passed the new folder which contains all the files if successful, error otherwise
Source:
Returns:
A promise resolving to the folder containing the transferred content
Type
Promise.<Object>

transferUserContent(sourceUserID, destUserID, callbackopt) → {Promise.<Object>}

Transfers all of a user's files into another user's account. API Endpoint: '/users/:sourceUserID/folders/0' Method: PUT
Parameters:
Name Type Attributes Description
sourceUserID string The ID of the user whose files will be transferred
destUserID string The ID of the user to transfer the files to
callback function <optional>
Passed the new folder which contains all the files if successful, error otherwise
Source:
Returns:
A promise resolving to the folder containing the transferred content
Type
Promise.<Object>