Class: Collaborations

Collaborations(client) → {void}

Simple manager for interacting with all 'Collaboration' endpoints and actions.

Constructor

new Collaborations(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

create(accessibleBy, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a collaborator to a folder. You'll have to create the 'accessible_by' input object yourself, but the method allows for multiple types of collaborator invites. See http://developers.box.com/docs/#collaborations-add-a-collaboration for formatting help. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
accessibleBy CollaborationAccesibleBy The accessible_by object expected by the API
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user or group will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
is_access_only boolean <optional>
WARN: Feature not yet available. Do not display collaborated items on collaborator's All Files Pages and suppress notifications sent to collaborators regarding access-only content. This feature is going to be released in Q4. Watch our [announcements](https://developer.box.com/changelog/) to learn about its availability.
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

create(accessibleBy, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a collaborator to a folder. You'll have to create the 'accessible_by' input object yourself, but the method allows for multiple types of collaborator invites. See http://developers.box.com/docs/#collaborations-add-a-collaboration for formatting help. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
accessibleBy CollaborationAccesibleBy The accessible_by object expected by the API
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user or group will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
is_access_only boolean <optional>
WARN: Feature not yet available. Do not display collaborated items on collaborator's All Files Pages and suppress notifications sent to collaborators regarding access-only content. This feature is going to be released in Q4. Watch our [announcements](https://developer.box.com/changelog/) to learn about its availability.
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithGroupID(groupID, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a group to collaborate on an item via their group ID. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
groupID int | string The ID of the group you'll invite as a collaborator
itemID string Box ID of the item to which the group should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the group will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithGroupID(groupID, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a group to collaborate on an item via their group ID. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
groupID int | string The ID of the group you'll invite as a collaborator
itemID string Box ID of the item to which the group should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the group will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithUserEmail(email, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a user to collaborate on an item via their user login email address. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
email string The collaborator's email address
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithUserEmail(email, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a user to collaborate on an item via their user login email address. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
email string The collaborator's email address
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithUserID(userID, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a user to collaborate on an item via their user ID. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
userID int | string The ID of the user you'll invite as a collaborator
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

createWithUserID(userID, itemID, role, optionsopt, callbackopt) → {Promise.<Collaboration>}

Invite a user to collaborate on an item via their user ID. API Endpoint: '/collaborations Method: POST
Parameters:
Name Type Attributes Description
userID int | string The ID of the user you'll invite as a collaborator
itemID string Box ID of the item to which the user should be invited
role CollaborationRole The role which the invited collaborator should have
options Object <optional>
Optional parameters for the collaboration
Properties
Name Type Attributes Default Description
type ItemType <optional>
folder Type of object to be collaborated
notify boolean <optional>
Determines if the user will receive email notifications
can_view_path boolean <optional>
Whether view path collaboration feature is enabled or not
callback function <optional>
Called with the new collaboration if successful
Source:
Returns:
A promise resolving to the created collaboration object
Type
Promise.<Collaboration>

delete(collaborationID, callbackopt) → {Promise.<void>}

Delete a given collaboration. API Endpoint: '/collaborations/:collaborationID' Method: DELETE
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
callback function <optional>
Empty response body passed if successful.
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

delete(collaborationID, callbackopt) → {Promise.<void>}

Delete a given collaboration. API Endpoint: '/collaborations/:collaborationID' Method: DELETE
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
callback function <optional>
Empty response body passed if successful.
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

get(collaborationID, optionsopt, callbackopt) → {Promise.<Collaboration>}

Requests a collaboration object with a given ID. API Endpoint: '/collaborations/:collaborationID' Method: GET
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
options Object <optional>
Additional options for the request. Can be left null in most cases.
callback function <optional>
Passed the collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the collaboration object
Type
Promise.<Collaboration>

get(collaborationID, optionsopt, callbackopt) → {Promise.<Collaboration>}

Requests a collaboration object with a given ID. API Endpoint: '/collaborations/:collaborationID' Method: GET
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
options Object <optional>
Additional options for the request. Can be left null in most cases.
callback function <optional>
Passed the collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the collaboration object
Type
Promise.<Collaboration>

getPending(callbackopt) → {Promise.<Collaborations>}

Gets a user's pending collaborations API Endpoint: '/collaborations' Method: GET
Parameters:
Name Type Attributes Description
callback function <optional>
Called with a collection of pending collaborations if successful
Source:
Returns:
A promise resolving to the collection of pending collaborations
Type
Promise.<Collaborations>

getPending(callbackopt) → {Promise.<Collaborations>}

Gets a user's pending collaborations API Endpoint: '/collaborations' Method: GET
Parameters:
Name Type Attributes Description
callback function <optional>
Called with a collection of pending collaborations if successful
Source:
Returns:
A promise resolving to the collection of pending collaborations
Type
Promise.<Collaborations>

respondToPending(collaborationID, newStatus, callbackopt) → {Promise.<Collaboration>}

Update the status of a pending collaboration. API Endpoint: '/collaborations/:collaborationID' Method: PUT
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
newStatus CollaborationStatus The new collaboration status ('accepted'/'rejected')
callback function <optional>
Passed the updated collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the accepted collaboration object
Type
Promise.<Collaboration>

respondToPending(collaborationID, newStatus, callbackopt) → {Promise.<Collaboration>}

Update the status of a pending collaboration. API Endpoint: '/collaborations/:collaborationID' Method: PUT
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
newStatus CollaborationStatus The new collaboration status ('accepted'/'rejected')
callback function <optional>
Passed the updated collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the accepted collaboration object
Type
Promise.<Collaboration>

update(collaborationID, updates, callbackopt) → {Promise.<Collaboration>}

Update some information about a given collaboration. API Endpoint: '/collaborations/:collaborationID' Method: PUT
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
updates CollaborationUpdate Fields of the collaboration to be updated
callback function <optional>
Passed the updated collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the updated collaboration object
Type
Promise.<Collaboration>

update(collaborationID, updates, callbackopt) → {Promise.<Collaboration>}

Update some information about a given collaboration. API Endpoint: '/collaborations/:collaborationID' Method: PUT
Parameters:
Name Type Attributes Description
collaborationID string Box ID of the collaboration being requested
updates CollaborationUpdate Fields of the collaboration to be updated
callback function <optional>
Passed the updated collaboration information if it was acquired successfully
Source:
Returns:
A promise resolving to the updated collaboration object
Type
Promise.<Collaboration>