---
title: Retrieve all accounts
slug: docs/demo/retrieve-all-accounts
description: Learn how to make a GET request to the fictive API endpoint for accounts using curl with this code example. Includes headers for accepting and sending JSON data. Enhance your programming skills and optimize your API interactions effortlessly.
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "j2Bn6W4w9Seo0KgiPMN6u",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts",
    "name": "Retrieve all accounts",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "emailAddress",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "clientUserId",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "firstName",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "surname",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "street",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "townCity",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "postCode",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "country",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "state",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "phoneNumber",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "dateOfBirth",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "rowsPerPage",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "pageNumber",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "useStartsWithSearch",
          "type": "boolean"
        }
      ],
      "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": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "accountReference",
                "type": "string",
                "example": "",
                "description": "Account reference"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<None | Active | Suspended | Closed | MWalletInactive>",
                "example": "",
                "description": "Status of account"
              },
              {
                "kind": "optional",
                "name": "verified",
                "type": "boolean",
                "example": "",
                "description": "Flag that marks if the account has been verified"
              },
              {
                "kind": "optional",
                "name": "email",
                "type": "string",
                "example": "",
                "description": "Email of account"
              },
              {
                "kind": "optional",
                "name": "clientUserId",
                "type": "string",
                "example": "",
                "description": "Client Id of the user"
              },
              {
                "kind": "optional",
                "name": "salutation",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "firstName",
                "type": "string",
                "example": "",
                "description": "Account first name"
              },
              {
                "kind": "optional",
                "name": "lastName",
                "type": "string",
                "example": "",
                "description": "Account last name"
              },
              {
                "kind": "optional",
                "name": "phoneNumber",
                "type": "string",
                "example": "",
                "description": "Account phone number"
              },
              {
                "kind": "optional",
                "name": "mobileNumber",
                "type": "string",
                "example": "",
                "description": "Account mobile number"
              },
              {
                "kind": "optional",
                "name": "dateOfBirth",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:12.0415324",
                "description": "Date of birth of the Account"
              },
              {
                "kind": "optional",
                "name": "gender",
                "type": "string<NotKnown | Female | Male>",
                "example": "",
                "description": "Gender"
              },
              {
                "kind": "optional",
                "name": "customParameters",
                "type": "object",
                "schema": [],
                "example": {},
                "description": "Custom parameters"
              },
              {
                "kind": "optional",
                "name": "sessionToken",
                "type": "string",
                "example": "",
                "description": "The session token"
              },
              {
                "kind": "optional",
                "name": "marketingAllowed",
                "type": "boolean",
                "example": "",
                "description": "Marketing Allowed"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.AccountResultNoAddress",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.AccountResultNoAddress[]",
            "isExpanded": true,
            "description": "Account"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "[\n  {\n    \"accountReference\": \"accRef\",\n    \"status\": \"Active\",\n    \"verified\": true,\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.1821545\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    },\n    \"marketingAllowed\": true\n  },\n  {\n    \"accountReference\": \"accRef\",\n    \"status\": \"Active\",\n    \"verified\": true,\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.1821545\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    },\n    \"marketingAllowed\": false\n  }\n]"
      },
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "accountReference",
                "type": "string",
                "example": "",
                "description": "Account reference"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<None | Active | Suspended | Closed | MWalletInactive>",
                "example": "",
                "description": "Status of account"
              },
              {
                "kind": "optional",
                "name": "verified",
                "type": "boolean",
                "example": "",
                "description": "Flag that marks if the account has been verified"
              },
              {
                "kind": "optional",
                "name": "email",
                "type": "string",
                "example": "",
                "description": "Email of account"
              },
              {
                "kind": "optional",
                "name": "clientUserId",
                "type": "string",
                "example": "",
                "description": "Client Id of the user"
              },
              {
                "kind": "optional",
                "name": "salutation",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "firstName",
                "type": "string",
                "example": "",
                "description": "Account first name"
              },
              {
                "kind": "optional",
                "name": "lastName",
                "type": "string",
                "example": "",
                "description": "Account last name"
              },
              {
                "kind": "optional",
                "name": "phoneNumber",
                "type": "string",
                "example": "",
                "description": "Account phone number"
              },
              {
                "kind": "optional",
                "name": "mobileNumber",
                "type": "string",
                "example": "",
                "description": "Account mobile number"
              },
              {
                "kind": "optional",
                "name": "dateOfBirth",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:12.0415324",
                "description": "Date of birth of the Account"
              },
              {
                "kind": "optional",
                "name": "gender",
                "type": "string<NotKnown | Female | Male>",
                "example": "",
                "description": "Gender"
              },
              {
                "kind": "optional",
                "name": "customParameters",
                "type": "object",
                "schema": [],
                "example": {},
                "description": "Custom parameters"
              },
              {
                "kind": "optional",
                "name": "sessionToken",
                "type": "string",
                "example": "",
                "description": "The session token"
              },
              {
                "kind": "optional",
                "name": "marketingAllowed",
                "type": "boolean",
                "example": "",
                "description": "Marketing Allowed"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.AccountResultNoAddress",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.AccountResultNoAddress[]",
            "isExpanded": true,
            "description": "Account"
          }
        ],
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to return all accounts or a subset based upon the filter criteria provided",
    "examples": {
      "languages": [
        {
          "id": "Qf_KnKDUnG_pMtqUWF6Eh",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/accounts \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "b83e3EclLd_FHOjby5ExX",
          "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\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "S2qF5g4S01PTwBHopnV5L",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts\")\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": "V2RmHO5hKgdVfhOF7nf1W",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts\"\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": "Qf_KnKDUnG_pMtqUWF6Eh"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n  {\n    \"accountReference\": \"accRef\",\n    \"status\": \"Active\",\n    \"verified\": true,\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.1821545\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    },\n    \"marketingAllowed\": true\n  },\n  {\n    \"accountReference\": \"accRef\",\n    \"status\": \"Active\",\n    \"verified\": true,\n    \"email\": \"Email\",\n    \"clientUserId\": \"ClientUserId\",\n    \"salutation\": \"Salutation\",\n    \"firstName\": \"FirstName\",\n    \"lastName\": \"LastName\",\n    \"phoneNumber\": \"PhoneNumber\",\n    \"mobileNumber\": \"MobileNumber\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.1821545\",\n    \"gender\": \"NotKnown\",\n    \"customParameters\": {\n      \"ParameterName\": \"ParameterValue\"\n    },\n    \"marketingAllowed\": false\n  }\n]"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// No Content.\n[\n  {\n    \"accountReference\": \"\",\n    \"status\": \"\",\n    \"verified\": false,\n    \"email\": \"\",\n    \"clientUserId\": \"\",\n    \"salutation\": \"\",\n    \"firstName\": \"\",\n    \"lastName\": \"\",\n    \"phoneNumber\": \"\",\n    \"mobileNumber\": \"\",\n    \"dateOfBirth\": \"2021-09-21T05:33:12.0415324\",\n    \"gender\": \"\",\n    \"customParameters\": {},\n    \"sessionToken\": \"\",\n    \"marketingAllowed\": false\n  }\n]"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}