Manage Applications

    List policy assignments

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

    Fetches all the storage policy assignment for an enterprise or user.

    Request

    application/json

    Query Parameters

    stringin queryoptional
    JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

    The position marker at which to begin the response.

    This requires usemarker to be set to true.

    stringin queryrequired
    984322

    The ID of the user or enterprise to return assignments for

    stringin queryrequired
    user

    The target type to return assignments for

    Value is one of "user", "enterprise"

    Response

    Returns a collection of storage policies for the enterprise or user.

    You can now try out some of our APIs live, right here in the documentation.
    Log In

    Request Example

    cURL
    curl -X GET https://api.box.com/2.0/storage_policy_assignments?resolved_for_type=userresolved_for_id=984322 \
         -H "Authorization: Bearer <ACCESS_TOKEN>"
    .NET
    BoxStoragePolicyAssignment assignment = client.StoragePoliciesManager
        .GetAssignmentForTargetAsync("22222");
    Java
    BoxStoragePolicyAssignment.Info assignmentInfo = BoxStoragePolicyAssignment.getAssignmentForTarget(api, "user", "1234")
    Python
    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))
    Node
    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' } }
            */
        });

    Response Example

    {
      "limit": 1000,
      "next_marker": 3000,
      "prev_marker": 1000,
      "entries": [
        {
          "storage_policy": {
            "id": 11446498,
            "type": "storage_policy"
          },
          "assigned_to": {
            "id": 11446498
          }
        }
      ]
    }