1つのコラボレーションを取得します。
コラボレーションオブジェクトを返します。
予期しないクライアントエラー。
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)")
}