---
title: Return session status
slug: docs/demo/return-session-status
description: Learn how to easily send a GET request to a simulated REST API endpoint using the curl command. This comprehensive document offers a code example that includes the necessary headers for accepting and sending JSON data. Enhance your understanding of API in
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "BpiY6YLPJwGPVIVO9dpFq",
  "data": {
    "url": "https://api.fictive.com/REST/api/sessions",
    "name": "Return session status",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "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": "The account Reference"
              },
              {
                "kind": "optional",
                "name": "shortSessionActive",
                "type": "boolean",
                "example": "",
                "description": "Is active low security"
              },
              {
                "kind": "optional",
                "name": "shortSessionExpiry",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:24.8230261",
                "description": "Is expired against low security"
              },
              {
                "kind": "optional",
                "name": "longSessionActive",
                "type": "boolean",
                "example": "",
                "description": "Is active high security"
              },
              {
                "kind": "optional",
                "name": "longSessionExpiry",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:24.8230261",
                "description": "Is expired against high security"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.SessionStatus",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v2.SessionStatus",
            "isExpanded": true,
            "description": "Session status"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"accountReference\": \"AccountReference\",\n  \"shortSessionActive\": true,\n  \"shortSessionExpiry\": \"2021-09-21T05:33:24.901147\",\n  \"longSessionActive\": true,\n  \"longSessionExpiry\": \"2021-09-21T05:33:24.901147\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Session has expired",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to verify the status of a session on the eSuite platform, using client-side authentication",
    "examples": {
      "languages": [
        {
          "id": "fGCdlgzXybHgk2K5V89Li",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/sessions \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "f5IalE4DIrhTw6t8k2fVz",
          "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/sessions\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "5KgE-Z4cr4H2Xw6j6Y3M0",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/sessions\")\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": "_VW4uHp09VJ80c4GNGCmA",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/sessions\"\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": "fGCdlgzXybHgk2K5V89Li"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"accountReference\": \"AccountReference\",\n  \"shortSessionActive\": true,\n  \"shortSessionExpiry\": \"2021-09-21T05:33:24.901147\",\n  \"longSessionActive\": true,\n  \"longSessionExpiry\": \"2021-09-21T05:33:24.901147\"\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Session has expired\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}