---
title: List SAPM Accounts Bound to the AAPM Account
slug: single-connect-api-3-2-0/list-sapm-accounts-bound-to-the-aapm-account
description: Learn how to make a GET request using cURL with this code example, including headers and data parameters. Discover how the `--location` flag enables redirects and the `--header` flag specifies the data type.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "p4966kUbCeWhe2XGnThfA",
  "data": {
    "url": "{{url}}/sc-aapm-ui/rest/aapm/listSAPMAccounts?token=TOKEN",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [
        {
          "name": "token",
          "type": "string",
          "example": "TOKEN",
          "description": "AAPM token"
        }
      ],
      "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": "",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This method lists the SAPM accounts that are bound to the AAPM account. The checkbox of \"Allow Listing Accounts\" in GUI should be checked for an account to let this method return a response.",
    "examples": {
      "languages": [
        {
          "id": "Yo3XEBMASapI0_G06XyDU",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url '{{url}}/sc-aapm-ui/rest/aapm/listSAPMAccounts?token=TOKEN' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "L8sQqgQCOppPmDjSmaZWY",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/sc-aapm-ui/rest/aapm/listSAPMAccounts?token=TOKEN\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "KTYlX2m7_mr0DSqyQHkvD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/sc-aapm-ui/rest/aapm/listSAPMAccounts?token=TOKEN\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Cex6UK3awnnYmyICManwS",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/sc-aapm-ui/rest/aapm/listSAPMAccounts?token=TOKEN\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Yo3XEBMASapI0_G06XyDU"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}