---
title: getDeviceGroupByParentGroupName
slug: single-connect-api-3-0-3/getdevicegroupbyparentgroupname
description: Learn how to use cURL to make a GET request and retrieve device groups by parent group name. Get step-by-step instructions, including the required URL, headers, and request body. The response will be in JSON format. Perfect for developers looking to integ
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "CCozmDQSLsOdNex9QOs81",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsByParentGroupName/PARENTGROUPNAME",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "getDeviceGroupByParentGroupName",
        "jsonExample": "[\n    {\n        \"dbId\": 826831,\n        \"id\": \"c85a9949-4ab4-459e-972b-2475385ee2a5\",\n        \"name\": \"testDG_child\",\n        \"description\": null,\n        \"parentGroupId\": \"1c2b4ba5-4ec9-4920-ac67-2de4229b2b72\",\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [],\n        \"deviceIds\": [],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"rootGroupId\": null,\n        \"globalUsername\": null,\n        \"globalPassword\": null,\n        \"showInDeviceTree\": true,\n        \"useAsRoleGroup\": true,\n        \"discoverySources\": null,\n        \"readOnly\": false\n    }\n]"
      }
    ],
    "contentType": "application/json",
    "description": "This method lists device groups with related parent group name sent in request url.\nAdd parent group name information in request url as PARENTGROUPNAME.",
    "examples": {
      "languages": [
        {
          "id": "QZGJMmxODl4RbcVsyofFe",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsByParentGroupName/PARENTGROUPNAME \\\n     --header 'accept: application/json'"
        },
        {
          "id": "9InaMo-fWWpYw2jjNWXRE",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsByParentGroupName/PARENTGROUPNAME\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "SCWu5AfKvNHl5GsYFo9Vu",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsByParentGroupName/PARENTGROUPNAME\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Jyb95yHGIyM7AKG0xkw8o",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsByParentGroupName/PARENTGROUPNAME\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "QZGJMmxODl4RbcVsyofFe"
    },
    "results": {
      "languages": [
        {
          "id": "yf3Tbpm8NbWRQkb_kny0A",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 826831,\n        \"id\": \"c85a9949-4ab4-459e-972b-2475385ee2a5\",\n        \"name\": \"testDG_child\",\n        \"description\": null,\n        \"parentGroupId\": \"1c2b4ba5-4ec9-4920-ac67-2de4229b2b72\",\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [],\n        \"deviceIds\": [],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"rootGroupId\": null,\n        \"globalUsername\": null,\n        \"globalPassword\": null,\n        \"showInDeviceTree\": true,\n        \"useAsRoleGroup\": true,\n        \"discoverySources\": null,\n        \"readOnly\": false\n    }\n]"
        }
      ],
      "selectedLanguageId": "yf3Tbpm8NbWRQkb_kny0A"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}