{"id":20905,"date":"2026-11-20T23:28:16","date_gmt":"2026-11-20T17:58:16","guid":{"rendered":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/"},"modified":"2026-11-20T23:28:16","modified_gmt":"2026-11-20T17:58:16","slug":"otp-widget-verify-token-webhook","status":"publish","type":"post","link":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/","title":{"rendered":"OTP widget webhook and f2s_token check: confirm the verified number on your server"},"content":{"rendered":"<p>The Fast2SMS OTP widget gives your page a one-time token called <code>f2s_token<\/code> after a visitor verifies their number. Your server checks that token with one API call and gets back the full verified mobile number. If you have no server code for forms, use the <strong>OTP widget webhook<\/strong> instead: Fast2SMS posts each verified number to your https URL, signed with a secret so you can trust it. This page shows both, with curl, PHP, Node.js and Python examples.<\/p>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Verify mobile numbers you can trust<\/strong><p>Create a free OTP widget and confirm every number on your server or webhook.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>Why check the token on your server<\/h2>\n<p>Anything that happens in the browser can be faked. A visitor can post your form without using the widget, fire a fake <code>f2s:verified<\/code> event or type any number into your own fields. The token is different: it is issued by Fast2SMS only after a correct code, it is tied to your widget, and only your API key can read it. Your page never sees the full number, only a masked one such as 98xxxxxx10. The full number comes to your server through the check below or through the webhook.<\/p>\n<p>If you are still setting up the widget, start with the <a href=\"https:\/\/www.fast2sms.com\/help\/free-otp-widget-for-website\/\">free OTP widget guide<\/a>. The widget is free. Only the OTPs it sends are charged, at your Smart OTP rate.<\/p>\n<div class=\"f2s-note f2s-volume\"><p><strong>Sending in bulk?<\/strong> For high OTP volumes our team offers discounted rates. <a href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Talk to our team<\/a> or see <a href=\"https:\/\/www.fast2sms.com\/bulk-sms-pricing\">OTP pricing<\/a>.<\/p><\/div>\n<h2>Where your server gets f2s_token<\/h2>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>Install mode<\/th>\n<th>How the token reaches you<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Form, or Mobile field inside a form<\/td>\n<td>A hidden form field named <code>f2s_token<\/code>, posted with your form<\/td>\n<\/tr>\n<tr>\n<td>Widget or Popup with &#8220;After verify, open a page&#8221;<\/td>\n<td>Added to your page address as <code>?f2s_token=...<\/code><\/td>\n<\/tr>\n<tr>\n<td>Widget or Popup with your own script<\/td>\n<td><code>event.detail.token<\/code> of the <code>f2s:verified<\/code> event; send it to your server yourself<\/td>\n<\/tr>\n<tr>\n<td>Any mode with the webhook on<\/td>\n<td>No token needed: the webhook already carries the verified number<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The four install modes are explained in <a href=\"https:\/\/www.fast2sms.com\/help\/otp-widget-popup-button-mobile-field\/\">OTP popup on button click, mobile field and form protect<\/a>.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp\" width=\"768\" height=\"598\" loading=\"lazy\" decoding=\"async\" alt=\"Sample sign-up form with name and email filled in and the OTP widget showing Mobile number verified above the Sign up button\"><figcaption>When this form is submitted, it carries a hidden f2s_token field.<\/figcaption><\/figure>\n<h2>Verify f2s_token with the verify-token API<\/h2>\n<p>The <strong>Server<\/strong> sub-tab under <strong>Install<\/strong> sums it up: check the f2s_token on your server, it works once, for 10 minutes.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-install-server-hd-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Install tab, Server sub-tab of the OTP widget with the curl command for the verify-token API and a Copy button\"><figcaption>Install, then Server: the ready curl command for checking f2s_token.<\/figcaption><\/figure>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>Part<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>URL<\/td>\n<td><code>https:\/\/www.fast2sms.com\/dev\/otp-widget\/verify-token<\/code><\/td>\n<\/tr>\n<tr>\n<td>Method<\/td>\n<td>POST<\/td>\n<\/tr>\n<tr>\n<td>Header<\/td>\n<td><code>authorization<\/code>: your API key (the account that owns the widget)<\/td>\n<\/tr>\n<tr>\n<td>token<\/td>\n<td>The value of <code>f2s_token<\/code><\/td>\n<\/tr>\n<tr>\n<td>mobile (optional)<\/td>\n<td>The number you expect; the answer is <code>mobile_mismatch<\/code> if it is a different one<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<pre><code class=\"language-bash\">curl -X POST https:\/\/www.fast2sms.com\/dev\/otp-widget\/verify-token \\\n  -H &quot;authorization: YOUR_API_KEY&quot; \\\n  -d &quot;token=TOKEN_FROM_f2s_token_FIELD&quot; \\\n  -d &quot;mobile=9876543210&quot;<\/code><\/pre>\n<p>A good token answers:<\/p>\n<pre><code class=\"language-json\">{&quot;valid&quot;:true,&quot;mobile&quot;:&quot;9876543210&quot;,&quot;verified_at&quot;:1763540000,&quot;verified_at_iso&quot;:&quot;...&quot;,&quot;origin&quot;:&quot;https:\/\/shop.example.com&quot;,&quot;widget_key&quot;:&quot;...&quot;}<\/code><\/pre>\n<p>Anything else answers <code>\"valid\":false<\/code> with a reason:<\/p>\n<pre><code class=\"language-json\">{&quot;valid&quot;:false,&quot;reason&quot;:&quot;expired&quot;}<\/code><\/pre>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>reason<\/th>\n<th>Meaning<\/th>\n<th>What to do<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>invalid<\/code><\/td>\n<td>Not a real token, or it belongs to a widget of another account<\/td>\n<td>Refuse the request<\/td>\n<\/tr>\n<tr>\n<td><code>expired<\/code><\/td>\n<td>More than 10 minutes since verification<\/td>\n<td>Ask the visitor to verify again<\/td>\n<\/tr>\n<tr>\n<td><code>used<\/code><\/td>\n<td>The token was already checked once<\/td>\n<td>Refuse; never check the same token twice<\/td>\n<\/tr>\n<tr>\n<td><code>mobile_mismatch<\/code><\/td>\n<td>Verified, but not the number you sent in <code>mobile<\/code><\/td>\n<td>Refuse; the token is used up by this check too<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Three rules to remember. A token is single use, so check it once and save the result. It is valid for 10 minutes, so check it as soon as the form arrives. And the API key must belong to the account that owns the widget. Find your key under <strong>API Key<\/strong> in the panel (see <a href=\"https:\/\/www.fast2sms.com\/help\/api-key-find-reset\/\">find or reset your API key<\/a>) and keep it in your server settings, never in a web page.<\/p>\n<h3>PHP<\/h3>\n<pre><code class=\"language-php\">&lt;?php\nfunction check_f2s_token(string $token, string $expectedMobile = ''): ?array\n{\n    $fields = ['token' =&gt; $token];\n    if (strlen($expectedMobile) &gt; 0) {\n        $fields['mobile'] = $expectedMobile;\n    }\n    $ch = curl_init('https:\/\/www.fast2sms.com\/dev\/otp-widget\/verify-token');\n    curl_setopt_array($ch, [\n        CURLOPT_POST           =&gt; true,\n        CURLOPT_POSTFIELDS     =&gt; http_build_query($fields),\n        CURLOPT_HTTPHEADER     =&gt; ['authorization: ' . getenv('FAST2SMS_API_KEY')],\n        CURLOPT_RETURNTRANSFER =&gt; true,\n        CURLOPT_TIMEOUT        =&gt; 10,\n    ]);\n    $result = json_decode((string) curl_exec($ch), true);\n    curl_close($ch);\n    return (is_array($result) &amp;&amp; ($result['valid'] ?? false) === true) ? $result : null;\n}\n\n\/\/ in your form handler\n$check = check_f2s_token($_POST['f2s_token'] ?? '');\nif ($check === null) {\n    http_response_code(400);\n    exit('Please verify your mobile number.');\n}\n$mobile = $check['mobile']; \/\/ full 10-digit number, safe to save<\/code><\/pre>\n<h3>Node.js<\/h3>\n<pre><code class=\"language-javascript\">\/\/ Node.js 18 or newer (built-in fetch)\nasync function checkF2sToken(token, expectedMobile) {\n  const body = new URLSearchParams({ token });\n  if (expectedMobile) body.append('mobile', expectedMobile);\n  const r = await fetch('https:\/\/www.fast2sms.com\/dev\/otp-widget\/verify-token', {\n    method: 'POST',\n    headers: { authorization: process.env.FAST2SMS_API_KEY },\n    body,\n  });\n  const result = await r.json();\n  return result.valid === true ? result : null;\n}\n\n\/\/ Express: const app = express(); app.use(express.urlencoded({ extended: false }));\napp.post('\/your-signup', async (req, res) =&gt; {\n  const check = await checkF2sToken(req.body.f2s_token || '');\n  if (check === null) return res.status(400).send('Please verify your mobile number.');\n  \/\/ check.mobile is the verified 10-digit number\n  res.send('Thanks, your number is verified.');\n});<\/code><\/pre>\n<h3>Python<\/h3>\n<pre><code class=\"language-python\">import os\nimport requests\n\ndef check_f2s_token(token, expected_mobile=None):\n    data = {&quot;token&quot;: token}\n    if expected_mobile:\n        data[&quot;mobile&quot;] = expected_mobile\n    r = requests.post(\n        &quot;https:\/\/www.fast2sms.com\/dev\/otp-widget\/verify-token&quot;,\n        headers={&quot;authorization&quot;: os.environ[&quot;FAST2SMS_API_KEY&quot;]},\n        data=data,\n        timeout=10,\n    )\n    result = r.json()\n    return result if result.get(&quot;valid&quot;) is True else None<\/code><\/pre>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-install-form-hd-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Install tab, Form sub-tab with the form code: data-f2s-otp-protect on the form tag and data-f2s-forward on the name and email inputs\"><figcaption>In Form mode, your form handler receives f2s_token.<\/figcaption><\/figure>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Add OTP checks to your sign-up<\/strong><p>One API call confirms the number. Your API key stays on your server.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>After verify, open a page<\/h2>\n<p>For the Widget and Popup modes you can send the visitor to a page of your own once the number is verified. In the widget&#8217;s <strong>Settings<\/strong>, turn on <strong>After verify, open a page<\/strong> and type the <strong>Page URL<\/strong>, for example https:\/\/www.demotraders.in\/thank-you. As the panel says, the page gets f2s_token, so your server can confirm the number. It arrives in the address, like <code>\/thank-you?f2s_token=...<\/code>.<\/p>\n<p>Check that token on the server side of the page before you show anything personal or save a lead. A visitor could open the thank-you page by hand, without a token or with an old one.<\/p>\n<pre><code class=\"language-php\">&lt;?php\n\/\/ https:\/\/www.demotraders.in\/thank-you?f2s_token=...\n\/\/ check_f2s_token() is the PHP function shown above\n$check = check_f2s_token($_GET['f2s_token'] ?? '');\nif ($check === null) {\n    exit('This link has expired. Please verify your number again.');\n}\necho 'Thank you. We will call you on ' . htmlspecialchars($check['mobile']) . '.';<\/code><\/pre>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-settings-on-redirect-hd-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Settings tab with After verify, open a page switched on and the Page URL https:\/\/www.demotraders.in\/thank-you, Send verified numbers to my webhook with the Webhook URL https:\/\/www.demotraders.in\/otp-verified and a Show webhook secret link, and Widget secret with a New secret button\"><figcaption>After verify page, webhook and widget secret in Settings.<\/figcaption><\/figure>\n<h2>OTP widget webhook: get each verified number<\/h2>\n<p>Turn on <strong>Send verified numbers to my webhook<\/strong> in <strong>Settings<\/strong> and type your <strong>Webhook URL<\/strong>. It must start with https. Click <strong>Show webhook secret<\/strong> and copy the secret (it starts with <code>whsec_<\/code>) into your server settings. After every successful verification, Fast2SMS sends a POST with a JSON body:<\/p>\n<pre><code class=\"language-json\">{\n  &quot;event&quot;: &quot;otp.verified&quot;,\n  &quot;widget_key&quot;: &quot;YOUR_WIDGET_KEY&quot;,\n  &quot;mobile&quot;: &quot;9876543210&quot;,\n  &quot;origin&quot;: &quot;https:\/\/www.demotraders.in&quot;,\n  &quot;verified_at&quot;: 1763540000,\n  &quot;fields&quot;: {&quot;name&quot;: &quot;Ketan Demo&quot;, &quot;email&quot;: &quot;ketan@demotraders.in&quot;}\n}<\/code><\/pre>\n<p><code>mobile<\/code> is the full verified number, <code>origin<\/code> is the website it was verified on, and <code>verified_at<\/code> is a Unix time. <code>fields<\/code> holds the values of form fields marked <code>data-f2s-forward<\/code>, so a site with no server code can still receive the name and email with the number. Two headers come with it:<\/p>\n<pre><code class=\"language-text\">X-F2S-Event: otp.verified\nX-F2S-Signature: t=1763540000,v1=5f0c...e91a<\/code><\/pre>\n<p>Fast2SMS waits up to 4 seconds for your answer and does not follow redirects, so answer with a 200 quickly and do slow work later. Treat the webhook as a notice. Where you must have the number, such as a sign-up, check <code>f2s_token<\/code> as well.<\/p>\n<h2>Verify the X-F2S-Signature header<\/h2>\n<ol>\n<li>Read the raw request body, exactly as received. Do not parse and re-encode the JSON before checking.<\/li>\n<li>Split the header into <code>t<\/code> (Unix time) and <code>v1<\/code> (the signature).<\/li>\n<li>Refuse the request if <code>t<\/code> is more than 5 minutes away from your server time. This stops someone replaying an old webhook.<\/li>\n<li>Work out HMAC-SHA256 of the text <code>&lt;t&gt;.&lt;raw body&gt;<\/code> with your webhook secret, as lowercase hex.<\/li>\n<li>Compare it with <code>v1<\/code> using a constant-time compare, such as <code>hash_equals<\/code> in PHP or <code>crypto.timingSafeEqual<\/code> in Node.js.<\/li>\n<\/ol>\n<h3>PHP webhook receiver<\/h3>\n<pre><code class=\"language-php\">&lt;?php\n$secret = getenv('F2S_WEBHOOK_SECRET');           \/\/ whsec_... from Show webhook secret\n$raw    = file_get_contents('php:\/\/input');        \/\/ the body exactly as received\n$header = $_SERVER['HTTP_X_F2S_SIGNATURE'] ?? '';\n\n$t = '';\n$v1 = '';\nforeach (explode(',', $header) as $part) {\n    $kv = explode('=', trim($part), 2);\n    if (count($kv) === 2 &amp;&amp; $kv[0] === 't')  { $t = $kv[1]; }\n    if (count($kv) === 2 &amp;&amp; $kv[0] === 'v1') { $v1 = $kv[1]; }\n}\n\n\/\/ refuse old or missing timestamps (5-minute window)\nif (ctype_digit($t) === false || abs(time() - (int) $t) &gt; 300) {\n    http_response_code(400);\n    exit;\n}\n\n$expected = hash_hmac('sha256', $t . '.' . $raw, $secret);\nif (hash_equals($expected, $v1) === false) {       \/\/ constant-time compare\n    http_response_code(401);\n    exit;\n}\n\n$event = json_decode($raw, true);\n\/\/ $event['mobile'], $event['origin'], $event['fields']['email'] ...\nhttp_response_code(200);<\/code><\/pre>\n<h3>Node.js (Express) webhook receiver<\/h3>\n<pre><code class=\"language-javascript\">const express = require('express');\nconst crypto = require('crypto');\nconst app = express();\nconst SECRET = process.env.F2S_WEBHOOK_SECRET; \/\/ whsec_... from Show webhook secret\n\n\/\/ express.raw keeps the body as bytes, exactly as Fast2SMS sent it\napp.post('\/otp-verified', express.raw({ type: 'application\/json' }), (req, res) =&gt; {\n  const parts = {};\n  for (const p of (req.get('X-F2S-Signature') || '').split(',')) {\n    const i = p.indexOf('=');\n    if (i &gt; 0) parts[p.slice(0, i).trim()] = p.slice(i + 1).trim();\n  }\n  const t = Number(parts.t);\n  const fresh = Number.isInteger(t) &amp;&amp; Math.abs(Date.now() \/ 1000 - t) &lt;= 300;\n\n  const expected = crypto.createHmac('sha256', SECRET)\n    .update(parts.t + '.')\n    .update(req.body)\n    .digest('hex');\n  const a = Buffer.from(expected);\n  const b = Buffer.from(parts.v1 || '');\n  const signed = a.length === b.length &amp;&amp; crypto.timingSafeEqual(a, b);\n\n  if (fresh &amp;&amp; signed) {\n    const event = JSON.parse(req.body.toString('utf8'));\n    \/\/ event.mobile, event.origin, event.fields\n    return res.sendStatus(200);\n  }\n  res.sendStatus(401);\n});<\/code><\/pre>\n<h2>New secret: when tokens or the webhook secret leak<\/h2>\n<p>Under <strong>Widget secret<\/strong> in Settings, the <strong>New secret<\/strong> button makes a fresh secret. As the panel says, a new secret makes old tokens invalid and changes the webhook secret. Use it if you think your webhook secret was exposed. Then copy the new webhook secret from <strong>Show webhook secret<\/strong> into your server at once, or your receiver will refuse the next webhooks. Visitors who verified just before the change must verify again.<\/p>\n<h2>Common problems and fixes<\/h2>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>Problem<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Every check answers <code>used<\/code><\/td>\n<td>Your code checks the token twice, for example on a page reload or a retry. Check once and keep the result.<\/td>\n<\/tr>\n<tr>\n<td>Every check answers <code>invalid<\/code><\/td>\n<td>Use the API key of the account that owns the widget, and send the token exactly as received.<\/td>\n<\/tr>\n<tr>\n<td>The signature never matches<\/td>\n<td>Sign the raw body, not re-encoded JSON, and use the current webhook secret, not your API key.<\/td>\n<\/tr>\n<tr>\n<td>No webhook arrives<\/td>\n<td>The URL must be https and reachable from the internet without a redirect. Check your server logs for the POST.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<section class=\"f2s-faq\">\n<h2>Frequently asked questions<\/h2>\n<h3>What is f2s_token?<\/h3>\n<p>A one-time token the OTP widget gives your page after a correct code. Your server sends it to the verify-token API to get the verified number.<\/p>\n<h3>How long is f2s_token valid?<\/h3>\n<p>10 minutes, and it works only once.<\/p>\n<h3>Do I need a server to use the OTP widget?<\/h3>\n<p>No. Without a server, turn on the webhook to receive each verified number. For accounts and orders, a server check of f2s_token is safer.<\/p>\n<h3>What does mobile_mismatch mean?<\/h3>\n<p>The token is real, but it was issued for a different number than the one you sent in <code>mobile<\/code>. Refuse the request.<\/p>\n<h3>How do I verify the OTP widget webhook signature?<\/h3>\n<p>Work out HMAC-SHA256 of <code>t + \".\" + raw body<\/code> with your <code>whsec_<\/code> secret, compare it with <code>v1<\/code> in constant time and refuse timestamps older than 5 minutes.<\/p>\n<h3>Can I use the same API key as for the Smart OTP API?<\/h3>\n<p>Yes, it is your account&#8217;s normal API key. It must be the account that owns the widget.<\/p>\n<\/section>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Start verifying numbers on your server<\/strong><p>Sign up free, create an OTP widget and check f2s_token with one API call.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>Related guides<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/free-otp-widget-for-website\/\">Free OTP widget for your website<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/otp-widget-popup-button-mobile-field\/\">OTP popup on button click, mobile field and form protect<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/\">Smart OTP verify OTP API<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/otp-sms-pumping-fraud-protection\/\">OTP SMS pumping fraud protection<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/otp-sms\">Smart OTP: SMS and WhatsApp OTP<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Fast2SMS OTP widget gives your page a one-time token called f2s_token after a visitor verifies their number. Your server checks that token with one API call and gets back the full verified mobile number. If you have no server code for forms, use the OTP widget webhook instead: Fast2SMS posts each verified number to [&hellip;]<\/p>\n","protected":false},"featured_media":20901,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-20905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-otp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>OTP Widget Webhook and f2s_token Check | Fast2SMS<\/title>\n<meta name=\"description\" content=\"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OTP Widget Webhook and f2s_token Check | Fast2SMS\" \/>\n<meta property=\"og:description\" content=\"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/\" \/>\n<meta property=\"og:site_name\" content=\"Fast2SMS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Fast2SMS\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-20T17:58:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1196\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fast2sms\" \/>\n<meta name=\"twitter:site\" content=\"@fast2sms\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"headline\":\"OTP widget webhook and f2s_token check: confirm the verified number on your server\",\"datePublished\":\"2026-11-20T17:58:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/\"},\"wordCount\":1372,\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/otpw-site-form-verified-hd.webp\",\"articleSection\":[\"API\",\"OTP\"],\"inLanguage\":\"en-IN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/\",\"name\":\"OTP Widget Webhook and f2s_token Check | Fast2SMS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/otpw-site-form-verified-hd.webp\",\"datePublished\":\"2026-11-20T17:58:16+00:00\",\"description\":\"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#breadcrumb\"},\"inLanguage\":\"en-IN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-IN\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/otpw-site-form-verified-hd.webp\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/otpw-site-form-verified-hd.webp\",\"width\":1536,\"height\":1196,\"caption\":\"Sample sign-up form with name and email filled in and the OTP widget showing Mobile number verified above the Sign up button\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/otp-widget-verify-token-webhook\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/api\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"OTP widget webhook and f2s_token check: confirm the verified number on your server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\",\"name\":\"Fast2SMS\",\"description\":\"Help\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"inLanguage\":\"en-IN\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\",\"name\":\"Fast2SMS\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"caption\":\"Fast2SMS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\"},\"email\":\"support@fast2sms.com\",\"telephone\":\"+91-6262778822\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Fast2SMS\",\"https:\\\/\\\/www.instagram.com\\\/fast2sms\",\"https:\\\/\\\/x.com\\\/fast2sms\",\"https:\\\/\\\/www.youtube.com\\\/Fast2SMSofficial\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/fast2sms\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OTP Widget Webhook and f2s_token Check | Fast2SMS","description":"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/","og_locale":"en_US","og_type":"article","og_title":"OTP Widget Webhook and f2s_token Check | Fast2SMS","og_description":"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.","og_url":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/","og_site_name":"Fast2SMS","article_publisher":"https:\/\/www.facebook.com\/Fast2SMS\/","article_published_time":"2026-11-20T17:58:16+00:00","og_image":[{"width":1536,"height":1196,"url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_creator":"@fast2sms","twitter_site":"@fast2sms","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#article","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/"},"author":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"headline":"OTP widget webhook and f2s_token check: confirm the verified number on your server","datePublished":"2026-11-20T17:58:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/"},"wordCount":1372,"publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp","articleSection":["API","OTP"],"inLanguage":"en-IN"},{"@type":"WebPage","@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/","url":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/","name":"OTP Widget Webhook and f2s_token Check | Fast2SMS","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#primaryimage"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp","datePublished":"2026-11-20T17:58:16+00:00","description":"Check the OTP widget f2s_token on your server with one API call, or get each verified number on a signed webhook. PHP, Node.js and Python examples inside.","breadcrumb":{"@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#breadcrumb"},"inLanguage":"en-IN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/"]}]},{"@type":"ImageObject","inLanguage":"en-IN","@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#primaryimage","url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp","contentUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otpw-site-form-verified-hd.webp","width":1536,"height":1196,"caption":"Sample sign-up form with name and email filled in and the OTP widget showing Mobile number verified above the Sign up button"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fast2sms.com\/help\/otp-widget-verify-token-webhook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fast2sms.com\/help\/"},{"@type":"ListItem","position":2,"name":"API","item":"https:\/\/www.fast2sms.com\/help\/api\/"},{"@type":"ListItem","position":3,"name":"OTP widget webhook and f2s_token check: confirm the verified number on your server"}]},{"@type":"WebSite","@id":"https:\/\/www.fast2sms.com\/help\/#website","url":"https:\/\/www.fast2sms.com\/help\/","name":"Fast2SMS","description":"Help","publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"inLanguage":"en-IN"},{"@type":"Organization","@id":"https:\/\/www.fast2sms.com\/#organization","name":"Fast2SMS","url":"https:\/\/www.fast2sms.com\/","logo":{"@type":"ImageObject","@id":"https:\/\/www.fast2sms.com\/#logo","url":"https:\/\/www.fast2sms.com\/Fast2SMS.png","contentUrl":"https:\/\/www.fast2sms.com\/Fast2SMS.png","caption":"Fast2SMS"},"image":{"@id":"https:\/\/www.fast2sms.com\/#logo"},"email":"support@fast2sms.com","telephone":"+91-6262778822","sameAs":["https:\/\/www.facebook.com\/Fast2SMS","https:\/\/www.instagram.com\/fast2sms","https:\/\/x.com\/fast2sms","https:\/\/www.youtube.com\/Fast2SMSofficial","https:\/\/www.linkedin.com\/company\/fast2sms"]}]}},"_links":{"self":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/20905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/comments?post=20905"}],"version-history":[{"count":0,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/20905\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media\/20901"}],"wp:attachment":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media?parent=20905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/categories?post=20905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/tags?post=20905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}