---
title: List Device Groups of Session User
slug: single-connect-api-3-0-3/list-device-groups-of-session-user
description: Learn how to make a GET request using the curl command with this code example. Follow step-by-step instructions on how to specify a specific URL and include headers for accepting and sending JSON data. Master the art of efficient data retrieval through th
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "ucBrrVpOQE92nkQozIC6M",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser",
    "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": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "getDeviceGroupsOfSessionUser",
        "jsonExample": "[\n    {\n        \"dbId\": 107395,\n        \"id\": \"8851fead-2b5e-4769-b847-fc8a898999a0\",\n        \"name\": \"SSH\",\n        \"description\": null,\n        \"parentGroupId\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            107888\n        ],\n        \"deviceIds\": [\n            137963\n        ],\n        \"properties\": {\n            \"globalUsername\": \"root\",\n            \"globalPassword\": \"8k646jpc0XKY+gdetfj3jw==\"\n        },\n        \"children\": null,\n        \"devices\": null,\n        \"rootGroupId\": null,\n        \"globalUsername\": \"root\",\n        \"globalPassword\": \"8k646jpc0XKY+gdetfj3jw==\",\n        \"showInDeviceTree\": true,\n        \"useAsRoleGroup\": true,\n        \"discoverySources\": null,\n        \"readOnly\": false\n    },\n    {\n        \"dbId\": 1,\n        \"id\": \"dg.sc_proxy\",\n        \"name\": \"SC Proxy\",\n        \"description\": null,\n        \"parentGroupId\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            1\n        ],\n        \"deviceIds\": [\n            1\n        ],\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 of logged on user.",
    "examples": {
      "languages": [
        {
          "id": "4xAEX2zTVAsmoQgTBLmQn",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser \\\n     --header 'accept: application/json'"
        },
        {
          "id": "jpnzVUbLhVaruOprDVORC",
          "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/discovery/getDeviceGroupsOfSessionUser\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "_Fmg63XU2qHY3vBY_MfCS",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser\")\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": "KrURDsz6sgqJ0GXKIqmSb",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser\"\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": "4xAEX2zTVAsmoQgTBLmQn"
    },
    "results": {
      "languages": [
        {
          "id": "yss1bTvsRa1qNMF82leUK",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 107395,\n        \"id\": \"8851fead-2b5e-4769-b847-fc8a898999a0\",\n        \"name\": \"SSH\",\n        \"description\": null,\n        \"parentGroupId\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            107888\n        ],\n        \"deviceIds\": [\n            137963\n        ],\n        \"properties\": {\n            \"globalUsername\": \"root\",\n            \"globalPassword\": \"8k646jpc0XKY+gdetfj3jw==\"\n        },\n        \"children\": null,\n        \"devices\": null,\n        \"rootGroupId\": null,\n        \"globalUsername\": \"root\",\n        \"globalPassword\": \"8k646jpc0XKY+gdetfj3jw==\",\n        \"showInDeviceTree\": true,\n        \"useAsRoleGroup\": true,\n        \"discoverySources\": null,\n        \"readOnly\": false\n    },\n    {\n        \"dbId\": 1,\n        \"id\": \"dg.sc_proxy\",\n        \"name\": \"SC Proxy\",\n        \"description\": null,\n        \"parentGroupId\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            1\n        ],\n        \"deviceIds\": [\n            1\n        ],\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": "yss1bTvsRa1qNMF82leUK"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}