CollaborationsModule
public class CollaborationsModule
Provides Collaborations management.
-
Initializer
Declaration
Swift
public init(boxClient: BoxClient)Parameters
boxClientRequired for communicating with Box APIs.
-
Get information about a collaboration.
Declaration
Swift
public func get( collaborationId: String, fields: [String]? = nil, completion: @escaping Callback<Collaboration> )Parameters
collaborationIdThe ID of the collaboration to get details
fieldsComma-separated list of fields to include in the response.
completionThe collaboration object is returned or an error
-
Create a new collaboration that grants a group access to a file or folder in a specific role.
Declaration
Swift
public func create( itemType: String, itemId: String, role: CollaborationRole, accessibleBy: String, accessibleByType: AccessibleBy, canViewPath: Bool? = nil, fields: [String]? = nil, notify: Bool? = nil, completion: @escaping Callback<Collaboration> )Parameters
itemTypeThe object type. Can be file or folder
itemIdThe id of the file or the folder
roleThe level of access granted. Can be editor, viewer, previewer, uploader, previewer uploader, viewer uploader, or co-owner.
accessibleByThe ID of the group that is granted access
accessibleByTypeCan be user or group
canViewPathWhether view path collaboration feature is enabled or not. View path collaborations allow the invitee to see the entire ancestral path to the associated folder. this parameter is only available for folder collaborations The user will not gain privileges in any ancestral folder (e.g. see content the user is not collaborated on).
fieldsAttribute(s) to include in the response
notifyDetermines if the user, (or all the users in the group) should receive email notification of the collaboration.
completionThe collaboration object is returned or an error
-
Create a new collaboration that grants a user to a file or folder in a specific role.
Declaration
Swift
public func createByUserEmail( itemType: String, itemId: String, role: CollaborationRole, login: String, canViewPath: Bool? = nil, fields: [String]? = nil, notify: Bool? = nil, completion: @escaping Callback<Collaboration> )Parameters
itemTypeThe object type. Can be file or folder
itemIdThe id of the file or the folder
roleThe level of access granted. Can be editor, viewer, previewer, uploader, previewer uploader, viewer uploader, or co-owner.
loginThe ID of the user or group that is granted access
canViewPathWhether view path collaboration feature is enabled or not. View path collaborations allow the invitee to see the entire ancestral path to the associated folder. this parameter is only available for folder collaborations The user will not gain privileges in any ancestral folder (e.g. see content the user is not collaborated on).
fieldsAttribute(s) to include in the response
notifyDetermines if the user, (or all the users in the group) should receive email notification of the collaboration.
completionThe collaboration object is returned or an error
-
Update a collaboration.
Declaration
Swift
public func update( collaborationId: String, role: CollaborationRole, status: CollaborationStatus? = nil, canViewPath: Bool? = nil, fields: [String]? = nil, completion: @escaping Callback<Collaboration> )Parameters
collaborationIdThe ID of the collaboration to get details
roleThe level of access granted. Can be editor, viewer, previewer, uploader, previewer uploader, viewer uploader, co-owner, or owner.
statusThe status of the collaboration invitation. Can be accepted or rejected.
canViewPathWhether view path collaboration feature is enabled or not. View path collaborations allow the invitee to see the entire ancestral path to the associated folder. The user will not gain privileges in any ancestral folder (e.g. see content the user is not collaborated on). This parameter is only available for folder collaborations
fieldsAttribute(s) to include in the response
completionThe collaboration object is returned or an error
-
Delete a collaboration.
Declaration
Swift
public func delete( collaborationId: String, completion: @escaping Callback<Void> )Parameters
collaborationIdThe ID of the collaboration to delete
completionAn empty response will be returned upon successful deletion or an error
-
Get information about a collaboration.
Declaration
Swift
public func listPendingForEnterprise( offset: Int? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PaginationIterator<Collaboration>Parameters
collaborationIdThe ID of the collaboration to get details
fieldsComma-separated list of fields to include in the response.
completionThe collaboration object is returned or an error
-
Retrieves the acceptance requirements status for a specified collaboration
Declaration
Swift
public func getAcceptanceRequirementsStatus( collaborationId: String, completion: @escaping Callback<Collaboration.AcceptanceRequirementsStatus> )Parameters
collaborationIdThe ID of the collaboration to get details
fieldsComma-separated list of fields to include in the response.
completionThe collaboration object is returned or an error
CollaborationsModule Class Reference