---
title: Get Device Groups by Phrase
slug: kron-pam-api-collection-340/get-device-groups-by-phrase
docTags: 
createdAt: 2024-07-12T13:38:00.278Z
---

{
  "id": "2hVNnIPtKLBcDNre9hi7m",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM",
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "x-xsrf-token",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Get Device Groups by Phrase",
        "jsonExample": "[\n    {\n        \"dbId\": 377038,\n        \"id\": \"e4442f9a-1144-4196-bb51-2aaee9405330\",\n        \"name\": \"SAPM device\",\n        \"description\": \"SAPM device\",\n        \"parentGroupId\": null,\n        \"parentGroupName\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            377043,\n            392562\n        ],\n        \"deviceIds\": [\n            377460\n        ],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"firstResult\": null,\n        \"maxResult\": null,\n        \"deviceCountInDb\": null,\n        \"label\": \"SAPM device (/)\",\n        \"fullPath\": \"/\",\n        \"showInDeviceTree\": true\n    }\n]"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "N35hNa3I044viba8wBaDA",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "GKcsvtBRYhaF0LmAkknu3",
          "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 requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "6nuRTM-LRV9KLXQOl6Ukv",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "hlnvSiycgVT53Vy06v5za",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "N35hNa3I044viba8wBaDA"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 377038,\n        \"id\": \"e4442f9a-1144-4196-bb51-2aaee9405330\",\n        \"name\": \"SAPM device\",\n        \"description\": \"SAPM device\",\n        \"parentGroupId\": null,\n        \"parentGroupName\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            377043,\n            392562\n        ],\n        \"deviceIds\": [\n            377460\n        ],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"firstResult\": null,\n        \"maxResult\": null,\n        \"deviceCountInDb\": null,\n        \"label\": \"SAPM device (/)\",\n        \"fullPath\": \"/\",\n        \"showInDeviceTree\": true\n    }\n]"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}