ストレージポリシーのリストを取得

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

会社のすべてのストレージポリシーを取得します。

リクエスト

application/json

クエリパラメータ

string arrayクエリ内省略可能
id,type,name

応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。

このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。

integer / int64クエリ内省略可能
10001000

返す項目の1ページあたりの最大数。

stringクエリ内省略可能
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。

これを使用するには、usemarkertrueに設定する必要があります。

レスポンス

ストレージポリシーのコレクションを返します。

予期しないクライアントエラー。

get
ストレージポリシーのリストを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

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)
    }
}