SINGLE CONNECT
...
API Guide
OTP Status and Validation
2 min
in order to send otpvalid request, otpstatus must be called first otpstatus method returns true, otpvalid should be sent otpstatus asks whether otp is active or inactive for the user, if otp is active this method generate valid otp value then returned true response { "tab" "examples", "url" "https //{{hostname}}/twofactorauth ui/rest/tfa/otpstatus", "name" "otpstatus", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "wp zhkly l snkilbnsqu", "code" "true > comment user otp status is opened\r\nfalse > comment user otp status is closed", "language" "200" } ], "selectedlanguageid" "wp zhkly l snkilbnsqu" }, "examples" { "languages" \[ { "id" "7rwed8lymvfy4hxykhqbo", "code" "var client = new restclient(\\"https //{{hostname}}/twofactorauth ui/rest/tfa/otpstatus\\");\r\nclient timeout = 1;\r\nvar request = new restrequest(method post);\r\nrequest addheader(\\"content type\\", \\"application/x www form urlencoded\\");\r\nrequest addheader(\\"cookie\\", \\"netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a\\");\r\nrequest addparameter(\\"username\\", \\"batuhan tests\\");\r\nrequest addparameter(\\"enduserip\\", \\"1 2 3 4\\");\r\nrequest addparameter(\\"applicationname\\", \\"batuhanbilgindeneme\\");\r\nirestresponse response = client execute(request);\r\nconsole writeline(response content);", "language" "csharp" }, { "id" "qafkpjc0ua3pdvmi6hxuu", "code" "curl location request post 'https //{{hostname}}/twofactorauth ui/rest/tfa/otpstatus' \\\\\n header 'content type application/x www form urlencoded' \\\\\n header 'cookie netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a' \\\\\n data urlencode 'username=batuhan test' \\\\\n data urlencode 'enduserip=1 2 3 4' \\\\\n data urlencode 'applicationname=batuhanbilgindeneme'", "language" "curl", "customlabel" "" }, { "id" "ylmfiuhrufpp0o 0qqqy0", "code" "var settings = {\r\n \\"url\\" \\"https //{{hostname}}/twofactorauth ui/rest/tfa/otpstatus\\",\r\n \\"method\\" \\"post\\",\r\n \\"timeout\\" 0,\r\n \\"headers\\" {\r\n \\"content type\\" \\"application/x www form urlencoded\\",\r\n \\"cookie\\" \\"netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a\\"\r\n },\r\n \\"data\\" {\r\n \\"username\\" \\"batuhan tests\\",\r\n \\"enduserip\\" \\"1 2 3 4\\",\r\n \\"applicationname\\" \\"batuhanbilgindeneme\\"\r\n }\r\n};\r\n\r\n$ ajax(settings) done(function (response) {\r\n console log(response);\r\n});", "language" "javascript" } ], "selectedlanguageid" "7rwed8lymvfy4hxykhqbo" }, "description" "otpstatus", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } { "tab" "examples", "url" "https //{{hostname}}/twofactorauth ui/rest/tfa/otpvalid", "name" "otpvalid", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "3xfrftxmavdeoy3feg2y1", "code" " comment otp is valid", "language" "200" }, { "id" "iztezgqr5rszlf3b1bbzf", "code" "\<!doctype html> > comment otp is not valid \r\n\<html lang=\\"en\\">\r\n\r\n\<head>\r\n\t\<title>http status 403 – forbidden\</title>\r\n\t\<style type=\\"text/css\\">\r\n\t\tbody {\r\n\t\t\tfont family tahoma, arial, sans serif;\r\n\t\t}\r\n\r\n\t\th1,\r\n\t\th2,\r\n\t\th3,\r\n\t\tb {\r\n\t\t\tcolor white;\r\n\t\t\tbackground color #525d76;\r\n\t\t}\r\n\r\n\t\th1 {\r\n\t\t\tfont size 22px;\r\n\t\t}\r\n\r\n\t\th2 {\r\n\t\t\tfont size 16px;\r\n\t\t}\r\n\r\n\t\th3 {\r\n\t\t\tfont size 14px;\r\n\t\t}\r\n\r\n\t\tp {\r\n\t\t\tfont size 12px;\r\n\t\t}\r\n\r\n\t\ta {\r\n\t\t\tcolor black;\r\n\t\t}\r\n\r\n\t\t line {\r\n\t\t\theight 1px;\r\n\t\t\tbackground color #525d76;\r\n\t\t\tborder none;\r\n\t\t}\r\n\t\</style>\r\n\</head>\r\n\r\n\<body>\r\n\t\<h1>http status 403 – forbidden\</h1>\r\n\</body>\r\n\r\n\</html>", "language" "403" } ], "selectedlanguageid" "3xfrftxmavdeoy3feg2y1" }, "examples" { "languages" \[ { "id" "li3k4lmubtut4fguzk9qf", "code" "var client = new restclient(\\"https //{{hostname}}/twofactorauth ui/rest/tfa/otpvalid\\");\r\nclient timeout = 1;\r\nvar request = new restrequest(method post);\r\nrequest addheader(\\"content type\\", \\"application/x www form urlencoded\\");\r\nrequest addheader(\\"cookie\\", \\"netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a\\");\r\nrequest addparameter(\\"username\\", \\"batuhan test\\");\r\nrequest addparameter(\\"token\\", \\"489375\\");\r\nrequest addparameter(\\"applicationname\\", \\"batuhanbilgindeneme\\");\r\nirestresponse response = client execute(request);\r\nconsole writeline(response content);", "language" "csharp" }, { "id" "hpozzli7npkotbn1cwlz5", "code" "curl location request post 'https //{{hostname}}/twofactorauth ui/rest/tfa/otpvalid' \\\\\r\n header 'content type application/x www form urlencoded' \\\\\r\n header 'cookie netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a' \\\\\r\n data urlencode 'username=batuhan test' \\\\\r\n data urlencode 'token=489375' \\\\\r\n data urlencode 'applicationname=batuhanbilgindeneme'", "language" "curl" }, { "id" "hmiky7fvl9psqx25ihscc", "code" "var settings = {\n \\"url\\" \\"https //{{hostname}}/twofactorauth ui/rest/tfa/otpvalid\\",\n \\"method\\" \\"post\\",\n \\"timeout\\" 0,\n \\"headers\\" {\n \\"content type\\" \\"application/x www form urlencoded\\",\n \\"cookie\\" \\"netright sessionid=8f118fa5 1d0a 433e 97b3 56dfec482b22; xsrf token=314cf821ce6395572ecd5ce8858bad3a\\"\n },\n \\"data\\" {\n \\"username\\" \\"batuhan test\\",\n \\"token\\" \\"296242\\",\n \\"applicationname\\" \\"batuhanbilgindeneme\\"\n }\n};\n\n$ ajax(settings) done(function (response) {\n console log(response);\n});", "language" "javascript" } ], "selectedlanguageid" "li3k4lmubtut4fguzk9qf" }, "description" "otpvalid", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } }