---
title: List Accounts of SAPM Group
slug: single-connect-api-3-0-3/list-accounts-of-sapm-group
description: Learn how to make a POST request using cURL with this code example. Discover how to include headers for accepting and sending JSON data to a particular URL. The data is sent as a string, making it easier to implement in your projects.
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "6NKwJ8sw-4RjhOEbYd9cm",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsOfSapmGroup",
    "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    \"firstResult\":0,\n    \"maxResult\":6\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 of which you sent dbId of. If you send applySub true, it will get sub-groups too.</p>\n<p>For pagination of the response the user should add following parameters:\r\n\"firstResult\":0,\r\n\"maxResult\":100</p>",
    "examples": {
      "languages": [
        {
          "id": "bTdSKUMegvirW7Uj0qAJB",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/listAccountsOfSapmGroup \\\n     --header 'accept: application/json'"
        },
        {
          "id": "e14vILnb0RwbqvQwHIPAL",
          "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/listAccountsOfSapmGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nVlWQpbbHBP46w4OH6ZpA",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsOfSapmGroup\")\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": "GAxQZIG5yKYBUJuhoiz3e",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/listAccountsOfSapmGroup\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "bTdSKUMegvirW7Uj0qAJB"
    },
    "results": {
      "languages": [
        {
          "id": "I_GgAzuwKnaFB76xK9Gxx",
          "language": "200",
          "code": "// List Accounts and Groups of SAPM Group\n"
        }
      ],
      "selectedLanguageId": "I_GgAzuwKnaFB76xK9Gxx"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}