Fetches all the storage policy assignment for an enterprise or user.
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.
This requires usemarker
to be set to true
.
984322
The ID of the user or enterprise to return assignments for
user
The target type to return assignments for
Value is one of user
,enterprise
Returns a collection of storage policies for the enterprise or user.
An unexpected client error.
curl -X GET https://api.box.com/2.0/storage_policy_assignments?resolved_for_type=userresolved_for_id=984322 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxStoragePolicyAssignment assignment = client.StoragePoliciesManager
.GetAssignmentForTargetAsync("22222");
BoxStoragePolicyAssignment.Info assignmentInfo = BoxStoragePolicyAssignment.getAssignmentForTarget(api, "user", "1234")
assignment = client.user(user_id='12345').get_storage_policy_assignment()
print('Assignment ID is {0} and the storage policy ID is {1}'.format(assignment.id, assignment.storage_policy.id))
client.storagePolicies.getAssignmentForTarget('22222')
.then(assignment => {
/* assignment -> {
type: 'storage_policy_assignment',
id: 'dXNlcl8yMjIyMg==',
storage_policy: 'storage_policy', id: '7' },
assigned_to: { type: 'user', id: '22222' } }
*/
});
client.storagePolicy.listAssignments(resolvedForType: "user", resolvedForId: "1234") { (result: Result<StoragePolicyAssignment, BoxSDKError>) in
guard case let .success(assignment) = result else {
print("Error getting storage policy assignment")
return
}
print("Storage policy assignment for user \(assignment.assignedTo?.id) is \(assignment.id)")
}