---
title: Get Policy Keys of a Policy Group by Policy Group ID
slug: single-connect-api-3-0-3/get-policy-keys-of-a-policy-group-by-policy-group-id
description: This document offers a practical code example using curl to effortlessly retrieve policy keys by policy group ID. It includes the necessary headers to ensure proper communication and exchange of JSON data during the GET request process. Simplify your deve
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "d47_MEFf9GbhsT8xP8fFu",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/getPolicyKeysByPolicyGroupId/POLICYGROUPID",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "List Policy Keys of a Policy Group by Policy Group ID",
        "jsonExample": "[\n    {\n        \"dbId\": 376251,\n        \"userCreate\": \"admin\",\n        \"userUpdate\": null,\n        \"creationDate\": 1581605373075,\n        \"lastUpdate\": null,\n        \"key\": \".*\",\n        \"description\": null,\n        \"userBehaviorRate\": null,\n        \"type\": \"WHITE\",\n        \"deviceTypes\": [\n            \"linux\"\n        ],\n        \"taskName\": null,\n        \"xmlContent\": null\n    }\n]"
      }
    ],
    "contentType": "application/json",
    "description": "This method responds with policy keys of a policy group whose ID is sent in request url.",
    "examples": {
      "languages": [
        {
          "id": "5r1OuZMbGBdUkZxGlvpfJ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/policy/getPolicyKeysByPolicyGroupId/POLICYGROUPID \\\n     --header 'accept: application/json'"
        },
        {
          "id": "Hi_AcYeP4aYldTT89UKsq",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/policy/getPolicyKeysByPolicyGroupId/POLICYGROUPID\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "GvtY1iVuqR86Vt-bwqTPD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/getPolicyKeysByPolicyGroupId/POLICYGROUPID\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "1YaDRrLgLgOa46MvCLV9Z",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/getPolicyKeysByPolicyGroupId/POLICYGROUPID\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "5r1OuZMbGBdUkZxGlvpfJ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 376251,\n        \"userCreate\": \"admin\",\n        \"userUpdate\": null,\n        \"creationDate\": 1581605373075,\n        \"lastUpdate\": null,\n        \"key\": \".*\",\n        \"description\": null,\n        \"userBehaviorRate\": null,\n        \"type\": \"WHITE\",\n        \"deviceTypes\": [\n            \"linux\"\n        ],\n        \"taskName\": null,\n        \"xmlContent\": null\n    }\n]"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}