GuidesCollaborationsGet Pending Collaborations
Edit this page

Get Pending Collaborations

Get Pending Collaborations

To get the pending collaborations for a user, call the GET /collaborations API with a status of pending.

cURL
curl -X GET https://api.box.com/2.0/collaborations?status=pending \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
.NET
BoxCollection<BoxCollaboration> pendingCollabs = await CollaborationsManager
    .GetPendingCollaborationAsync();
Java
Collection<BoxCollaboration.Info> pendingCollaborations =
    BoxCollaboration.getPendingCollaborations(api);
Python
pending_collaborations = client.get_pending_collaborations()
for pending_collaboration in pending_collaborations:
    print('Collaboration {0} is pending'.format(pending_collaboration.id))
Node
client.collaborations.getPending()
	.then(collaborations => {
		/* collaborations -> {
			total_count: 1,
			entries: [
				{
					type: 'collaboration',
					id: '11111',
					created_by: {
						type: 'user',
						id: '22222',
						name: 'Example User',
						login: 'user@example.com'
					},
					created_at: '2011-11-29T12:56:35-08:00',
					modified_at: '2012-09-11T15:12:32-07:00',
					expires_at: null,
					status: 'pending',
					accessible_by: {
						type: 'user',
						id: '33333',
						name: 'Collaborator User',
						login: 'collaborator@example.com'
					},
					role: 'editor',
					acknowledged_at: '2011-11-29T12:59:40-08:00',
					item: null
				}
			]
		}
		*/
	});
iOS
client.collaborations.listPendingForEnterprise() { results in
    switch results {
    case let .success(iterator):
        for i in 1 ... 10 {
            iterator.next { result in
                switch result {
                case let .success(collaboration):
                    print("Collaboration created by \(collaboration.createdBy?.name)")
                case let .failure(error):
                    print(error)
                }
            }
        }
    case let .failure(error):
        print(error)
    } 
}

This only returns the current list of pending collaborations for a user. This API does not allow for returning all collaborations for a user.