---
title: List Accounts and Groups of SAPM Group
slug: single-connect-api-3-2-0/list-accounts-and-groups-of-sapm-group
description: Learn how to make a POST request to a specific URL using curl with this helpful code example. Discover how to include headers for accepting and sending JSON data, as well as sending a data payload in the form of a JSON object. Improve your coding skills a
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "2nHw2LB4Bxvp4zpec9UaD",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsAndGroupsOfSapmGroup",
    "method": "POST",
    "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": "{\n\t\"dbId\": 85202,\n\t\"applySub\": true\n}\n",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "List Accounts and Groups of SAPM Group",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>This API allows you to list SAPM group's accounts and subs-groups of which you sent dbId of. If you send applySub true, it will get sub-groups too.</p>",
    "examples": {
      "languages": [
        {
          "id": "YthrkvOuW1TCj5pL_KqoF",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/listAccountsAndGroupsOfSapmGroup \\\n     --header 'accept: application/json'"
        },
        {
          "id": "BtNvI2aG9T9hr8Xvdl9Wy",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsAndGroupsOfSapmGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "56R3Kd0Ilf2C2jJzeD_m5",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsAndGroupsOfSapmGroup\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "DYsYSw2CasYGnFp91WnQ7",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsAndGroupsOfSapmGroup\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "YthrkvOuW1TCj5pL_KqoF"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// List Accounts and Groups of SAPM Group\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}