---
title: Retrieve account
slug: docs/demo/retrieve-account
description: This document offers a detailed code example showcasing the usage of the curl command for making a GET request to a fictional API endpoint. It focuses on retrieving account information, highlighting the inclusion of necessary headers to accept and send JS
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "yaNo7It30jSQFw8GO_MsK",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}",
    "name": "Retrieve account",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "Account reference"
        }
      ],
      "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": "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  \"accountReference\": \"accRef\",\n  \"status\": \"Active\",\n  \"verified\": false,\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:13.2134261\",\n  \"gender\": \"NotKnown\",\n  \"customParameters\": {\n    \"ParameterName\": \"ParameterValue\"\n  },\n  \"sessionToken\": \"7a709ba3add44e40af29637a2ffb130c\",\n  \"marketingAllowed\": true\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "• Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "• Email does not exist for given client",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "• Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to return the account",
    "examples": {
      "languages": [
        {
          "id": "9OE30dFLH8ukvd_5TbwYp",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "yHIvMsvBOfEkfJgxZXm6f",
          "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}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "FdjqkRZlBUJ444NiRfSzU",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}\")\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": "EGDRRG-59s3v9pXzqYPiT",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}\"\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": "9OE30dFLH8ukvd_5TbwYp"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"accountReference\": \"accRef\",\n  \"status\": \"Active\",\n  \"verified\": false,\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:13.2134261\",\n  \"gender\": \"NotKnown\",\n  \"customParameters\": {\n    \"ParameterName\": \"ParameterValue\"\n  },\n  \"sessionToken\": \"7a709ba3add44e40af29637a2ffb130c\",\n  \"marketingAllowed\": true\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// • Not Authorized\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// • Email does not exist for given client\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// • Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}