List storage policies

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

Fetches all the storage policies in the enterprise.

Request

application/json

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

integer / int64in queryoptional
10001000

The maximum number of items to return per page.

stringin queryoptional
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.

Response

application/jsonStorage policies

Returns a collection of storage policies.

application/jsonClient error

An unexpected client error.

get
List storage policies
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_policies \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
.NET
BoxCollectionMarkerBased<BoxStoragePolicy> policies = await client.StoragePoliciesManager
    .GetListStoragePoliciesAsync();
Java
Iterable<BoxStoragePolicy.Info> storagePolicies = BoxStoragePolicy.getAll(api);
for (BoxStoragePolicy.Info storagePolicyInfo : storagePolicies) {
        //Do something with the storage policy.
}
Python
storage_policies = client.get_storage_policies(limit=100)
for storage_policy in storage_policies:
    print('The storage policy id is {0} and name is {1}'.format(storage_policy.id, storage_policy.name)))
Node
client.storagePolicies.getAll()
    .then(policies => {
        /* policies -> {
            next_marker: null,
            limit: 1000,
            entries: 
            [ { type: 'storage_policy', id: '42', name: 'Montreal / Dublin' },
                { type: 'storage_policy', id: '126', name: 'Frankfurt / Dublin' },
                { type: 'storage_policy', id: '162', name: 'US' } ] }
        */
    });
iOS
client.storagePolicies.list() { results in
    switch results {
    case let .success(iterator):
        for i in 1 ... 10 {
            iterator.next { result in
                switch result {
                case let .success(policy):
                    print("Storage policy \(policy.id)")
                case let .failure(error):
                    print(error)
                }
            }
        }
    case let .failure(error):
        print(error)
    }
}