---
title: List Sapm Groups
slug: single-connect-api-3-0-3/list-sapm-groups
description: This document offers a code example illustrating how to make a GET request with the curl command. Learn how to specify a URL and include headers to accept and send JSON data effectively. Enhance your web development skills with this useful resource.
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "9x_yjt39315HAR84mUCXs",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/listSapmGroups",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Get Sapm Groups",
        "jsonExample": "[\n    {\n        \"dbId\": 9257,\n        \"id\": \"9bcb8c02-ec4b-4ad4-8825-c071c9eac8d1\",\n        \"name\": \"test group\",\n        \"description\": null,\n        \"parentSapmGroupId\": null,\n        \"userCreate\": \"admin\",\n        \"userPermissionLevel\": 3,\n        \"approvalStatus\": null,\n        \"fullPath\": \"/test group\"\n    }\n]"
      }
    ],
    "contentType": "application/json",
    "description": "This method returns all SAPM groups that authenticated user is allowed to see. ",
    "examples": {
      "languages": [
        {
          "id": "wzHfozfLhIXL7yeKFolF2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/listSapmGroups \\\n     --header 'accept: application/json'"
        },
        {
          "id": "cs-rCPkY0d0Tudife07zr",
          "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/sc/sapm/listSapmGroups\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Q4a5tfXR6CZMty4G2r52E",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/listSapmGroups\")\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": "I29A4FysxGDKcQ_4MklC6",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/listSapmGroups\"\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": "wzHfozfLhIXL7yeKFolF2"
    },
    "results": {
      "languages": [
        {
          "id": "lKC9n1jlvuVRvc0Hzjw-y",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 9257,\n        \"id\": \"9bcb8c02-ec4b-4ad4-8825-c071c9eac8d1\",\n        \"name\": \"test group\",\n        \"description\": null,\n        \"parentSapmGroupId\": null,\n        \"userCreate\": \"admin\",\n        \"userPermissionLevel\": 3,\n        \"approvalStatus\": null,\n        \"fullPath\": \"/test group\"\n    }\n]"
        }
      ],
      "selectedLanguageId": "lKC9n1jlvuVRvc0Hzjw-y"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}