---
title: Retrieve All Members.
slug: docs/demo/retrieve-all-members
description: Learn how to make a GET request and retrieve member information from a fictional API using a code example. This document outlines the use of the curl command and provides the necessary headers for accepting and sending JSON data. Empower your programming 
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "enY06T3WzfhkTC42F6cU_",
  "data": {
    "url": "https://api.fictive.com/REST/api/groups/{accountGroupToken}/members",
    "name": "Retrieve All Members.",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountGroupToken",
          "type": "string",
          "description": "The account group token used to identify the account group."
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "role",
          "type": "string",
          "description": "The account's role within the group."
        },
        {
          "kind": "optional",
          "name": "rowsPerPage",
          "type": "integer",
          "description": "Number of rows per page"
        },
        {
          "kind": "optional",
          "name": "currentPage",
          "type": "integer",
          "description": "Current page"
        },
        {
          "kind": "optional",
          "name": "firstName",
          "type": "string",
          "description": "First name"
        },
        {
          "kind": "optional",
          "name": "surName",
          "type": "string",
          "description": "Surname"
        }
      ],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "totalNumberOfRecords",
                "type": "integer<int32>",
                "example": 0,
                "description": "Total number of records in search"
              },
              {
                "kind": "optional",
                "name": "pageNumber",
                "type": "integer<int32>",
                "example": 0,
                "description": "Current page number of result"
              },
              {
                "kind": "optional",
                "name": "resultsPerPage",
                "type": "integer<int32>",
                "example": 0,
                "description": "Number of items per page"
              },
              {
                "kind": "optional",
                "name": "items",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Account Reference"
                  },
                  {
                    "kind": "optional",
                    "name": "groupRole",
                    "type": "string<Unspecified | User | Payee | Admin>",
                    "example": "",
                    "description": "Group role"
                  },
                  {
                    "kind": "optional",
                    "name": "clientUserId",
                    "type": "string",
                    "example": "",
                    "description": "Client user id"
                  },
                  {
                    "kind": "optional",
                    "name": "email",
                    "type": "string",
                    "example": "",
                    "description": "Email"
                  },
                  {
                    "kind": "optional",
                    "name": "firstName",
                    "type": "string",
                    "example": "",
                    "description": "First name"
                  },
                  {
                    "kind": "optional",
                    "name": "surname",
                    "type": "string",
                    "example": "",
                    "description": "Surname"
                  },
                  {
                    "kind": "optional",
                    "name": "subscriptions",
                    "type": "array",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "subscriptionId",
                        "type": "integer<int32>",
                        "example": 0,
                        "description": "Subscription id"
                      },
                      {
                        "kind": "optional",
                        "name": "subscriptionTitle",
                        "type": "string",
                        "example": "",
                        "description": "Subscription title"
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountSubscriptionLiteDto",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountSubscriptionLiteDto[]",
                    "description": "The list with the subscriptions that account is associated"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.GroupAccount",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.GroupAccount[]",
                "description": "Generic items"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.SearchData[FictiveGlobal.Api.Rest.Dtos.v3.GroupAccount]",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.SearchData[FictiveGlobal.Api.Rest.Dtos.v3.GroupAccount]",
            "isExpanded": true,
            "description": "Generic type for search result"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"totalNumberOfRecords\": 2,\n  \"pageNumber\": 1,\n  \"resultsPerPage\": 500,\n  \"items\": [\n    {\n      \"accountReference\": \"0123ABC4DEFGHIJ5K6\",\n      \"groupRole\": \"Payee\",\n      \"clientUserId\": \"015488FDD\",\n      \"email\": \"Joe.Bloggs@email.com\",\n      \"firstName\": \"Joe\",\n      \"surname\": \"Bloggs\",\n      \"subscriptions\": [\n        {\n          \"subscriptionId\": 12345,\n          \"subscriptionTitle\": \"This is the first subscription title\"\n        },\n        {\n          \"subscriptionId\": 12346,\n          \"subscriptionTitle\": \"This is the second subscription title\"\n        }\n      ]\n    },\n    {\n      \"accountReference\": \"0123ABC4DEFGHIJ5K7\",\n      \"groupRole\": \"User\",\n      \"clientUserId\": \"015488FDE\",\n      \"email\": \"John.Doe@email.com\",\n      \"firstName\": \"John\",\n      \"surname\": \"Doe\",\n      \"subscriptions\": [\n        {\n          \"subscriptionId\": 12347,\n          \"subscriptionTitle\": \"This is the third subscription title\"\n        },\n        {\n          \"subscriptionId\": 12348,\n          \"subscriptionTitle\": \"This is the fourth subscription title\"\n        }\n      ]\n    }\n  ]\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "The AccountGroupToken is not valid.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Account Group cannot be found.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will enable you to retrieve all accounts that belong to a specific account group.",
    "examples": {
      "languages": [
        {
          "id": "uUTTkwi3_yYnKfSQcAnLG",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location --globoff 'https://api.fictive.com/REST/api/groups/{accountGroupToken}/members' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'"
        },
        {
          "id": "omJTGtAKjgk3AbQ1UvNm0",
          "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(\"https://api.fictive.com/REST/api/groups/{accountGroupToken}/members\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "OVdaHdcKcT3ApGTioAAW_",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/groups/{accountGroupToken}/members\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Br_WNxdgA2062VvFRfKYJ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/groups/{accountGroupToken}/members\"\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": "uUTTkwi3_yYnKfSQcAnLG"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"totalNumberOfRecords\": 2,\n  \"pageNumber\": 1,\n  \"resultsPerPage\": 500,\n  \"items\": [\n    {\n      \"accountReference\": \"0123ABC4DEFGHIJ5K6\",\n      \"groupRole\": \"Payee\",\n      \"clientUserId\": \"015488FDD\",\n      \"email\": \"Joe.Bloggs@email.com\",\n      \"firstName\": \"Joe\",\n      \"surname\": \"Bloggs\",\n      \"subscriptions\": [\n        {\n          \"subscriptionId\": 12345,\n          \"subscriptionTitle\": \"This is the first subscription title\"\n        },\n        {\n          \"subscriptionId\": 12346,\n          \"subscriptionTitle\": \"This is the second subscription title\"\n        }\n      ]\n    },\n    {\n      \"accountReference\": \"0123ABC4DEFGHIJ5K7\",\n      \"groupRole\": \"User\",\n      \"clientUserId\": \"015488FDE\",\n      \"email\": \"John.Doe@email.com\",\n      \"firstName\": \"John\",\n      \"surname\": \"Doe\",\n      \"subscriptions\": [\n        {\n          \"subscriptionId\": 12347,\n          \"subscriptionTitle\": \"This is the third subscription title\"\n        },\n        {\n          \"subscriptionId\": 12348,\n          \"subscriptionTitle\": \"This is the fourth subscription title\"\n        }\n      ]\n    }\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The AccountGroupToken is not valid.\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Account Group cannot be found.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}