Retrieves a single collaboration.
1234
The ID of the collaboration
id,type,name
A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
Returns a collaboration object.
An unexpected client error.
curl -X GET https://api.box.com/2.0/collaborations/1234 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxCollaboration collab = await client.CollaborationsManager.GetCollaborationAsync(id: "22222");
BoxCollaboration collaboration = new BoxCollaboration(api, "id");
BoxCollaboration.Info info = collaboration.getInfo();
collaboration = client.collaboration(collab_id='12345').get()
var collaborationID = '22222';
client.collaborations.get(collaborationID)
.then(collaboration => {
/* collaboration -> {
type: 'collaboration',
id: '22222',
created_by: {
type: 'user',
id: '11111',
name: 'Example User',
login: 'user@example.com'
},
created_at: '2012-12-12T10:54:37-08:00',
modified_at: '2012-12-12T11:30:43-08:00',
expires_at: null,
status: 'accepted',
accessible_by: {
type: 'user',
id: '33333',,
name: 'Collaborator User',
login: 'collaborator@example.com'
},
role: 'editor',
acknowledged_at: '2012-12-12T11:30:43-08:00',
item: {
type: 'folder',
id: '12345',
sequence_id: '0',
etag: '0',
name: 'Shared Pictures'
}
}
*/
});
client.collaborations.get(collaborationId: "12345") { (result: Result<Collaboration, BoxSDKError>) in
guard case let .success(collaboration) = result else {
print("Error retrieving collaboration")
return
}
let collaborator: String
switch collaboration.accessibleBy.collaboratorValue {
case let .user(user):
collaborator = "user \(user.name)"
case let .group(group):
collaborator = "group \(group.name)"
}
let itemName: String
switch collaboration.item {
case let .file(file):
itemName = file.name
case let .folder(folder):
itemName = folder.name
case let .webLink(webLink):
itemName = webLink.name
}
print("Collaboration \(collaboration.id) gives \(collaborator) access to \(itemName)")
}