title: What is duplicate-or-timeout error message in Google's reCAPTCHA v3
body: <p>I am using Google's reCaptcha v3 in html page, that's still in beta version. (<a href="https://developers.google.com/recaptcha/docs/v3" rel="nofollow noreferrer">reCaptcha v3 docs</a>)</p>
  
  <p>The html page consists of two buttons and clicking each causes a back-end web service method to be called using jquery ajax i.e. form is not being submitted on clicking these buttons. If <em>Contact Us</em> button is clicked then the web service method ContactUs is called and if <em>Buy</em> button is clicked then the Buy method of web service is called.</p>
  
  <p>If I click on Contact Us button after page renders, then I get a response as below which is what I expect since I am not a bot.</p>
  
  <blockquote>
    <p>{success: true, challenge_ts:"2018-05-12T05:40:23Z", hostname:"localhost", score: 0.9}</p>
  </blockquote>
  
  <p>Then, if I click the other button i.e. Buy button, I always get a response as below.</p>
  
  <blockquote>
    <p>{success: false,  error-codes": ["timeout-or-duplicate"]}</p>
  </blockquote>
  
  <p><strong>Question</strong></p>
  
  <p>Why is the response from recaptcha always false with above error message of timeout-or-duplicate when I click on Buy button?</p>
  
  <p>I just want to make sure that these buttons are not being clicked by a bot and I thought recaptcha v3 would help in this, but it seems the full page needs to postback i.e. form needs to be submitted after each click of a button for it to work.</p>
  
  <p><strong>Html code</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;reCaptcha v3&lt;/title&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;script src="Scripts/jquery-1.11.3.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src='https://www.google.com/recaptcha/api.js?render=keyValue'&gt;&lt;/script&gt;
      &lt;script&gt;
          function verify(action) {
              grecaptcha.execute('clientkeyValue')
                  .then(function (token) {
                      $.ajax({
                          type: "POST",
                          url: "SomeWebService.asmx/VerifyCaptchaV3",
                          data: JSON.stringify({ response: token }),
                          success: function (r) {
                              if (r &amp;&amp; JSON.parse(r).success === true) {
                                  verified = true;
  
                                  if (action === "contactus") {
                                      //code for calling ContactUs method in web service
                                  } else if (action === "buy") {
                                      //code for calling Buy method in web service
                                  }
                              } else {
                                  verified = false;
                              }
                          },
                          contentType: "application/json; charset=utf-8",
                          dataType: "json"
                      });
                  });
              }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form action="javascript:grecaptcha.reset();" method="post"&gt;
          &lt;div id="example3"&gt;&lt;/div&gt;
          &lt;br&gt;
          &lt;input type="submit" value="Contact Us" id="submit" onclick="verify('contactus'); return false;"&gt;
          &lt;input type="submit" value="Buy" id="submit1" onclick="verify('buy'); return false;"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Web Service method in C# to call server-side recaptcha siteVerify</strong></p>
  
  <pre><code>public string VerifyCaptchaV3(string response) {
      string url = "https://www.google.com/recaptcha/api/siteverify?secret=someValue&amp;response=" + response;
      return (new System.Net.WebClient()).DownloadString(url);
  }
  </code></pre>