---
title: List Device Groups of Session User
slug: kronpam-api-collection-350/list-device-groups-of-session-user
docTags: 
createdAt: 2024-07-22T09:58:47.220Z
---

{
  "id": "MULO2UdAtaZ2OEJLYTN7Y",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser",
    "name": "",
    "description": "This method lists Device groups of logged on user.",
    "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": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "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]"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "a58GDlEXtM9gFsvx1i8-J",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsOfSessionUser \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "bI_Si8zmOjmBX8SYr91OT",
          "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/getDeviceGroupsOfSessionUser\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "_fuS5ij2sCX4syWIMFsGW",
          "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\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "C56dK-Mi6vEsKP1aP9Cl3",
          "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   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "a58GDlEXtM9gFsvx1i8-J"
    },
    "results": {
      "languages": [
        {
          "id": "43U-X2UrJrBTJzFw-eisV",
          "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": "43U-X2UrJrBTJzFw-eisV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}