---
title: Login
slug: tp-api/login
docTags: 
createdAt: 2023-12-26T14:37:58.070Z
---

{
  "id": "TIGWz7xp1WVDod2BtRN6O",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}login",
    "servers": [
      {
        "url": "{{url}}login",
        "description": "Development environment"
      }
    ],
    "name": "Login",
    "description": "<p>The login method is the primary gateway to the KRON DSP. Before accessing any other functionalities or methods, users must authenticate themselves using this method by username and password. Successfully logging in provides the user with a session ID, which is essential for subsequent interactions with the system.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "customType": "AuthObject",
          "schema": [
            {
              "name": "username",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "password",
              "kind": "optional",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/AuthObject",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "cookieAuth",
          "name": "SESSION",
          "kind": "optional",
          "type": "apiKey",
          "in": "cookie"
        },
        {
          "id": "tokenAuth",
          "name": "X-XSRF-TOKEN",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "Om5wW6bEgRar6CpoAgemh",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}login \\\n     --header 'accept: application/json'"
        },
        {
          "id": "67phQ2WH5iK0U62sof8Fo",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}login\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QBHueXgWbw9J20_WkA7QE",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}login\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "pD3CyLCtElRKE6qHy_TeI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}login\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Om5wW6bEgRar6CpoAgemh"
    },
    "results": {
      "languages": [
        {
          "id": "VcowHOvHziYAYPs2nr4ta",
          "language": "200",
          "code": "// OK\n"
        }
      ],
      "selectedLanguageId": "VcowHOvHziYAYPs2nr4ta"
    }
  },
  "children": [
    {
      "id": "suydjFjlKHH6lf8wic3KP",
      "type": "paragraph",
      "children": [
        {
          "text": "The login method is the primary gateway to the KRON DSP. Before accessing any other functionalities or methods, users must authenticate themselves using this method by username and password. Successfully logging in provides the user with a session ID, which is essential for subsequent interactions with the system.",
          "id": "HXRYYbLl80VNN2oQj735A"
        }
      ]
    }
  ]
}