コラボレーションを取得

get
https://api.box.com/2.0
/collaborations/:collaboration_id

1つのコラボレーションを取得します。

リクエスト

application/json

パスパラメータ

stringパス内必須
1234

コラボレーションのID

クエリパラメータ

string arrayクエリ内省略可能
id,type,name

応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。

このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。

レスポンス

application/jsonCollaboration

コラボレーションオブジェクトを返します。

予期しないクライアントエラー。

get
コラボレーションを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -X GET https://api.box.com/2.0/collaborations/1234 \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
.NET
BoxCollaboration collab = await client.CollaborationsManager.GetCollaborationAsync(id: "22222");
Java
BoxCollaboration collaboration = new BoxCollaboration(api, "id");
BoxCollaboration.Info info = collaboration.getInfo();
Python
collaboration = client.collaboration(collab_id='12345').get()
Node
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'
			}
		}
		*/
	});
iOS
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)")
}