Box Developerドキュメント

ストレージポリシー割り当てを取得

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

特定のストレージポリシー割り当てを取得します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

パスパラメータ

stringパス内必須
932483

ストレージポリシー割り当てのID。

レスポンス

ストレージポリシー割り当てオブジェクトを返します。

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

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

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/storage_policy_assignments/932483" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.storagePolicyAssignments.getStoragePolicyAssignmentById(
  storagePolicyAssignment.id,
);
Python Gen
client.storage_policy_assignments.get_storage_policy_assignment_by_id(
    storage_policy_assignment.id
)
.NET Gen
await client.StoragePolicyAssignments.GetStoragePolicyAssignmentByIdAsync(storagePolicyAssignmentId: storagePolicyAssignment.Id);
Java
BoxStoragePolicyAssignment storagePolicyAssignment = new BoxStoragePolicyAssignment(api, id);
BoxStoragePolicyAssignment.Info assignmentInfo = storagePolicyAssignment.getInfo();
Python
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
BoxStoragePolicyAssignment assignment = await client.StoragePoliciesManager
    .GetAssignmentAsync(assignmentId: "dXNlcl8yMjIyMg==");
Node
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' } }
        */
    });
iOS
client.storagePolicy.getAssignment(storagePolicyAssignmentId: "1234") { (result: Result<StoragePolicyAssignment, BoxSDKError>) in
    guard case let .success(assignment) = result else {
        print("Error getting storage policy assignment")
        return
    }
    print("Storage policy assignment ID \(assignment.id)")
}

レスポンスの例

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