Box Developer Documentation
Latest version

Get storage policy assignment

get
https://api.box.com/2.0
/storage_policy_assignments/:storage_policy_assignment_id

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Fetches a specific storage policy assignment.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
932483

The ID of the storage policy assignment.

Response

Returns a storage policy assignment object.

application/jsonClient error

An unexpected client error.

get
Get storage policy assignment
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versionig strategy.


cURL
curl -i -X GET "https://api.box.com/2.0/storage_policy_assignments/932483" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.storagePolicyAssignments.getStoragePolicyAssignmentById(
  storagePolicyAssignment.id,
);
Python v10
client.storage_policy_assignments.get_storage_policy_assignment_by_id(
    storage_policy_assignment.id
)
.NET v10
await client.StoragePolicyAssignments.GetStoragePolicyAssignmentByIdAsync(storagePolicyAssignmentId: storagePolicyAssignment.Id);
Swift v10
try await client.storagePolicyAssignments.getStoragePolicyAssignmentById(storagePolicyAssignmentId: storagePolicyAssignment.id)
Java v10
client.getStoragePolicyAssignments().getStoragePolicyAssignmentById(storagePolicyAssignment.getId())
Java v4
BoxStoragePolicyAssignment storagePolicyAssignment = new BoxStoragePolicyAssignment(api, id);
BoxStoragePolicyAssignment.Info assignmentInfo = storagePolicyAssignment.getInfo();
Python v3
assignment = client.storage_policy_assignment(assignment_id='12345').get()
print(f'Assignment ID is {assignment.id} and the storage policy ID is {assignment.storage_policy.id}')
.NET v5
BoxStoragePolicyAssignment assignment = await client.StoragePoliciesManager
    .GetAssignmentAsync(assignmentId: "dXNlcl8yMjIyMg==");
Node v3
client.storagePolicies.getAssignment('dXNlcl8yMjIyMg==')
    .then(assignment => {
        /* assignment -> {
            type: 'storage_policy_assignment',
            id: 'dXNlcl8yMjIyMg==',
            storage_policy: 'storage_policy', id: '7' },
            assigned_to: { type: 'user', id: '22222' } }
        */
    });

Response Example

{
  "id": "ZW50ZXJwcmlzZV8xMjM0NTY3ODkw",
  "type": "storage_policy_assignment",
  "assigned_to": {
    "id": "11446498",
    "type": "file"
  },
  "storage_policy": {
    "id": "11446498",
    "type": "storage_policy"
  }
}