---
title: Retrieve Groups Assigned to an Account
slug: docs/demo/retrieve-groups-assigned-to-an-account
description: Learn how to make a GET request to a fictive API endpoint with this handy code example using curl. This step-by-step guide demonstrates how to include headers for accepting and sending JSON data in your request. Discover the endpoint URL structure, which 
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "aIlN2QJ1wJJroAae5eA6g",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/groups",
    "name": "Retrieve Groups Assigned to an Account",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "The account reference identifier"
        }
      ],
      "queryParameters": [],
      "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": "groups",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "role",
                    "type": "string<Unspecified | User | Payee | Admin>",
                    "example": "",
                    "description": "Role"
                  },
                  {
                    "kind": "optional",
                    "name": "groupInfo",
                    "type": "object",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "accountGroupName",
                        "type": "string",
                        "example": "",
                        "description": "AccountGroupName"
                      },
                      {
                        "kind": "optional",
                        "name": "accountGroupToken",
                        "type": "string",
                        "example": "",
                        "description": "AccountGroupToken"
                      },
                      {
                        "kind": "optional",
                        "name": "created",
                        "type": "string<date-time>",
                        "example": "2021-09-21T05:33:07.0570589",
                        "description": "Created"
                      },
                      {
                        "kind": "optional",
                        "name": "lastUpdated",
                        "type": "string<date-time>",
                        "example": "2021-09-21T05:33:07.0570589",
                        "description": "LastUpdated"
                      },
                      {
                        "kind": "optional",
                        "name": "payeeInfo",
                        "type": "object",
                        "schema": [
                          {
                            "kind": "optional",
                            "name": "clientUserId",
                            "type": "string",
                            "example": "",
                            "description": "ClientUserId"
                          },
                          {
                            "kind": "optional",
                            "name": "firstName",
                            "type": "string",
                            "example": "",
                            "description": "FirstName"
                          },
                          {
                            "kind": "optional",
                            "name": "lastName",
                            "type": "string",
                            "example": "",
                            "description": "LastName"
                          },
                          {
                            "kind": "optional",
                            "name": "email",
                            "type": "string",
                            "example": "",
                            "description": "Email"
                          }
                        ],
                        "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountGroupInfoPayeeAccount",
                        "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountGroupInfoPayeeAccount",
                        "description": "PayeeInfo"
                      },
                      {
                        "kind": "optional",
                        "name": "ipRanges",
                        "type": "array",
                        "schema": [
                          {
                            "kind": "optional",
                            "name": "ipAddressReference",
                            "type": "string",
                            "example": "",
                            "description": "IpAddressReference"
                          },
                          {
                            "kind": "optional",
                            "name": "start",
                            "type": "string",
                            "example": "",
                            "description": "Start of the range"
                          },
                          {
                            "kind": "optional",
                            "name": "end",
                            "type": "string",
                            "example": "",
                            "description": "End of the range"
                          }
                        ],
                        "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.IpRange",
                        "customType": "FictiveGlobal.Api.Rest.Dtos.v1.IpRange[]",
                        "description": "IpRanges"
                      },
                      {
                        "kind": "optional",
                        "name": "emailDomains",
                        "type": "array",
                        "example": [],
                        "itemType": "string",
                        "customType": "string[]",
                        "description": "EmailDomains",
                        "itemExample": ""
                      },
                      {
                        "kind": "optional",
                        "name": "permitUserPayments",
                        "type": "boolean",
                        "example": "",
                        "description": "PermitUserPayments"
                      },
                      {
                        "kind": "optional",
                        "name": "matchEmailOnlyAfterIpMatch",
                        "type": "boolean",
                        "example": "",
                        "description": "MatchEmailOnlyAfterIpMatch"
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountGroupInfo",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountGroupInfo",
                    "description": "GroupInfo"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountGroup",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountGroup[]",
                "description": "Groups"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.AccountGroups",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.AccountGroups",
            "isExpanded": true,
            "description": "AccountGroups class"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"groups\": [\n    {\n      \"role\": \"Unspecified\",\n      \"groupInfo\": {\n        \"accountGroupName\": \"Example Name\",\n        \"accountGroupToken\": \"021a1ef9-303a-4e6b-b3ab-4b4cd2d464fc\",\n        \"created\": \"2016-11-28T00:00:00\",\n        \"lastUpdated\": \"2016-11-28T00:00:00\",\n        \"payeeInfo\": {\n          \"clientUserId\": \"123454\",\n          \"firstName\": \"James\",\n          \"lastName\": \"Jones\",\n          \"email\": \"jj@test.com\"\n        },\n        \"ipRanges\": [\n          {\n            \"start\": \"127.0.0.1\",\n            \"end\": \"127.0.0.255\"\n          }\n        ],\n        \"emailDomains\": [\n          \"@test.com\",\n          \"@testglobal.com\"\n        ],\n        \"permitUserPayments\": true,\n        \"matchEmailOnlyAfterIpMatch\": true\n      }\n    }\n  ]\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will enable you to retrieve a list of all account groups that an existing account belongs to.",
    "examples": {
      "languages": [
        {
          "id": "M1NLqhFEdxtJ1gNefK3kH",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/groups \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "aLpNV54OMJm_2wAAA7a53",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "bydNJNdNCDQtTZqMvYyLa",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\")\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\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "dOshR06DIPYbBK833N1pl",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/groups\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "M1NLqhFEdxtJ1gNefK3kH"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"groups\": [\n    {\n      \"role\": \"Unspecified\",\n      \"groupInfo\": {\n        \"accountGroupName\": \"Example Name\",\n        \"accountGroupToken\": \"021a1ef9-303a-4e6b-b3ab-4b4cd2d464fc\",\n        \"created\": \"2016-11-28T00:00:00\",\n        \"lastUpdated\": \"2016-11-28T00:00:00\",\n        \"payeeInfo\": {\n          \"clientUserId\": \"123454\",\n          \"firstName\": \"James\",\n          \"lastName\": \"Jones\",\n          \"email\": \"jj@test.com\"\n        },\n        \"ipRanges\": [\n          {\n            \"start\": \"127.0.0.1\",\n            \"end\": \"127.0.0.255\"\n          }\n        ],\n        \"emailDomains\": [\n          \"@test.com\",\n          \"@testglobal.com\"\n        ],\n        \"permitUserPayments\": true,\n        \"matchEmailOnlyAfterIpMatch\": true\n      }\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}