---
title: List All Masking Policies
slug: kronpam-api-collection-350/list-all-masking-policies
docTags: 
createdAt: 2024-07-22T09:58:47.227Z
---

{
  "id": "EuNGZv35LzBCSmrG5AMdB",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/sqlproxy/listMaskingPolicy",
    "name": "",
    "description": "<p>This method lists masking policies. To get entire records, no property should be posted in the body. To filter any property, related property and the value can be entered in the body of the request.\r\nIf no data is found, the method returns empty response.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/json",
          "value": "application/json",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\r\n    \"name\": \"new policy\",\r\n    \"description\": \"new masking policy\",\r\n    \"datasourceDbId\": 582647,\r\n    \"active\": true,\r\n    \"rowLimit\": 50,\r\n    \"schema\": \"*\",\r\n    \"table\": \"EMPLOYEES\",\r\n    \"column\": \"FIRST_NAME\",\r\n    \"methodDbId\": 465445\r\n}\r\n",
          "value": "{\r\n    \"name\": \"new policy\",\r\n    \"description\": \"new masking policy\",\r\n    \"datasourceDbId\": 582647,\r\n    \"active\": true,\r\n    \"rowLimit\": 50,\r\n    \"schema\": \"*\",\r\n    \"table\": \"EMPLOYEES\",\r\n    \"column\": \"FIRST_NAME\",\r\n    \"methodDbId\": 465445\r\n}\r\n",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "CXeprcEncMqmYDw4rkm72",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sqlproxy/listMaskingPolicy \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"{\\r\\n    \\\"name\\\": \\\"new policy\\\",\\r\\n    \\\"description\\\": \\\"new masking policy\\\",\\r\\n    \\\"datasourceDbId\\\": 582647,\\r\\n    \\\"active\\\": true,\\r\\n    \\\"rowLimit\\\": 50,\\r\\n    \\\"schema\\\": \\\"*\\\",\\r\\n    \\\"table\\\": \\\"EMPLOYEES\\\",\\r\\n    \\\"column\\\": \\\"FIRST_NAME\\\",\\r\\n    \\\"methodDbId\\\": 465445\\r\\n}\\r\\n\"'"
        },
        {
          "id": "MLcqQtGPAazHOsDuMZkK5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar raw = JSON.stringify(\"{\\r\\n    \\\"name\\\": \\\"new policy\\\",\\r\\n    \\\"description\\\": \\\"new masking policy\\\",\\r\\n    \\\"datasourceDbId\\\": 582647,\\r\\n    \\\"active\\\": true,\\r\\n    \\\"rowLimit\\\": 50,\\r\\n    \\\"schema\\\": \\\"*\\\",\\r\\n    \\\"table\\\": \\\"EMPLOYEES\\\",\\r\\n    \\\"column\\\": \\\"FIRST_NAME\\\",\\r\\n    \\\"methodDbId\\\": 465445\\r\\n}\\r\\n\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sqlproxy/listMaskingPolicy\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nXriCnvwBz7BJqxV47hzF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sqlproxy/listMaskingPolicy\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"{\\r\\n    \\\"name\\\": \\\"new policy\\\",\\r\\n    \\\"description\\\": \\\"new masking policy\\\",\\r\\n    \\\"datasourceDbId\\\": 582647,\\r\\n    \\\"active\\\": true,\\r\\n    \\\"rowLimit\\\": 50,\\r\\n    \\\"schema\\\": \\\"*\\\",\\r\\n    \\\"table\\\": \\\"EMPLOYEES\\\",\\r\\n    \\\"column\\\": \\\"FIRST_NAME\\\",\\r\\n    \\\"methodDbId\\\": 465445\\r\\n}\\r\\n\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "rHrELRah6TGEfJI-0U-pp",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sqlproxy/listMaskingPolicy\"\n\npayload = json.dumps(\"{\\r\\n    \\\"name\\\": \\\"new policy\\\",\\r\\n    \\\"description\\\": \\\"new masking policy\\\",\\r\\n    \\\"datasourceDbId\\\": 582647,\\r\\n    \\\"active\\\": true,\\r\\n    \\\"rowLimit\\\": 50,\\r\\n    \\\"schema\\\": \\\"*\\\",\\r\\n    \\\"table\\\": \\\"EMPLOYEES\\\",\\r\\n    \\\"column\\\": \\\"FIRST_NAME\\\",\\r\\n    \\\"methodDbId\\\": 465445\\r\\n}\\r\\n\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "CXeprcEncMqmYDw4rkm72"
    },
    "results": {
      "languages": [
        {
          "id": "s1H_3sLsdUdj4Okb0cP_5",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "s1H_3sLsdUdj4Okb0cP_5"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}