---
title: OTP Last Used Time
slug: kron-pam-api-collection-381-patch3/otp-last-used-time
docTags: 
createdAt: 2026-10-21T06:07:16.182Z
---

{
  "id": "e9pEaX2FNzb1Z9QE47W_3",
  "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": "JdAyXAaclyWxQK_AdDhf0",
          "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": "MuEi2VS1KMVu0ymCAZGZg",
          "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": "0ZJarp4HkbJua_i5w7VjS",
          "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": "eJkVQ70tvwaeWRnjI2LnJ",
          "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": "JdAyXAaclyWxQK_AdDhf0"
    },
    "results": {
      "languages": [
        {
          "id": "bYT8WhYC_xPR_K3E07St9",
          "language": "200",
          "code": "0"
        }
      ],
      "selectedLanguageId": "bYT8WhYC_xPR_K3E07St9"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}