Get Pending Collaborations

Guides Collaborations Get Pending Collaborations
Edit this page

Get Pending Collaborations

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

cURL
curl -i -X GET "https://api.box.com/2.0/collaborations?status=pending" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.listCollaborations.getCollaborations({
  status: 'pending' as GetCollaborationsQueryParamsStatusField,
} satisfies GetCollaborationsQueryParams);
Python Gen
client.list_collaborations.get_collaborations(GetCollaborationsStatus.PENDING.value)
.NET Gen (Beta)
await client.ListCollaborations.GetCollaborationsAsync(queryParams: new GetCollaborationsQueryParams(status: GetCollaborationsQueryParamsStatusField.Pending));
Python
pending_collaborations = client.get_pending_collaborations()
for pending_collaboration in pending_collaborations:
    print(f'Collaboration {pending_collaboration.id} is pending')
.NET
BoxCollection<BoxCollaboration> pendingCollabs = await CollaborationsManager
    .GetPendingCollaborationAsync();
Java
Collection<BoxCollaboration.Info> pendingCollaborations =
    BoxCollaboration.getPendingCollaborations(api);
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
let iterator = client.collaborations.listPendingForEnterprise()
iterator.next { result in
    switch result {
    case let .success(page):
        for collaboration in page.entries {
            print("Collaboration created by \(collaboration.createdBy?.name)")
        }

    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.