---
title: OTP Last Used Time
slug: kron-pam-api-collection-3-9-0/otp-last-used-time
docTags: 
createdAt: 2026-10-21T06:10:28.166Z
---

{
  "id": "kbSs-5dtqIZtLngv0FaKC",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/tfa/lastOtp",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>The <strong>OTP Last Used Time</strong> method provides the last creation time of the generated OTP for a user.</p>\n<h4>Usage:</h4>\n<ul>\n<li>\n<p>Enter the <code>username</code>, <code>endUserIp</code>, and <code>applicationName</code> in the request body.</p>\n</li>\n<li>\n<p>Ensure all parameters are mandatory and the request body is URL Encoded.</p>\n</li>\n</ul>\n<p>This method is essential for tracking the last time an OTP was generated for a user, aiding in security and access management.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/x-www-form-urlencoded",
          "value": "application/x-www-form-urlencoded",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "username",
          "description": "",
          "default": "admin",
          "value": "admin",
          "type": "string"
        },
        {
          "name": "endUserIp",
          "description": "",
          "default": "10.20.50.99",
          "value": "10.20.50.99",
          "type": "string"
        }
      ],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OTP Last Used Time",
        "jsonExample": "0"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "xgH3pkj7OjJPzv2r7JiVH",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/tfa/lastOtp \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/x-www-form-urlencoded' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --form 'username=\"admin\"' \\\n     --form 'endUserIp=\"10.20.50.99\"'"
        },
        {
          "id": "fmYq9Q1FPHcHSlkuorSmd",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/x-www-form-urlencoded\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar formdata = new FormData();\nformdata.append(\"username\", \"admin\");\nformdata.append(\"endUserIp\", \"10.20.50.99\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: formdata,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/tfa/lastOtp\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "XXjj0SO431CehTzQsOOAM",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/tfa/lastOtp\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/x-www-form-urlencoded\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nform_data = [['username', File.open('undefined')],['endUserIp', File.open('undefined')]]\nrequest.set_form form_data, 'multipart/form-data'\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "kS-8iC1IyIq6B3WcPRmBe",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/tfa/lastOtp\"\n\npayload = {}\nfiles=[\n\n]\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/x-www-form-urlencoded',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload, files=files)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "xgH3pkj7OjJPzv2r7JiVH"
    },
    "results": {
      "languages": [
        {
          "id": "G95Kgh3ZS5a5KNG0TE-04",
          "language": "200",
          "code": "0"
        }
      ],
      "selectedLanguageId": "G95Kgh3ZS5a5KNG0TE-04"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}