title: Php form to work with this otp based code login
body: <p>This code is used to send request to the server to obtain token</p>
  <p>This code will send the otp</p>
  <pre><code>   const URL = 'https://api.gotinder.com/';```
  
  
  ``` /**
      * Sends SMS message to user to verify their account
      *
      * @param string $phoneNumber Your phone number associated with your tinder account
      *
      * @throws
      *
      * @return string
      */
     public function requestCode($phoneNumber)
     {
         $number_plus = $phoneNumber;
         $number = ltrim($number_plus, '+');
         $number = preg_replace(&quot;/[^0-9]/&quot;, &quot;&quot;, $number);
         $code = $this-&gt;getCode($number);
          try {
             $response = $this-&gt;client-&gt;post(self::URL . '/v3/auth/login?locale=en', [
                 'body' =&gt;  $code.$number,
                 'headers' =&gt; $headers
             ]);
         } catch (\Exception $e) {
             return $e-&gt;getMessage();
         }
  
         return $response-&gt;getBody()-&gt;getContents();
     }
  </code></pre>
  <p>This code will validate the otp</p>
  <pre><code>
      /**
       * Sends SMS message to user to verify their account
       *
       * @param string $phoneNumber Your phone number associated with your tinder account
       *
       * @throws
       *
       * @return string
       */
      public function validateCode($phoneNumber, $code)
      {
         $data = ['otp_code' =&gt; $code, 'phone_number' =&gt; $phoneNumber, 'is_update' =&gt; false];
  
          try {
              $response = $this-&gt;client-&gt;post(self::URL . '/v2/auth/sms/validate?auth_type=sms&amp;locale=en', [
                  'json' =&gt; $data,
                  'headers' =&gt; $headers
              ]);
          } catch (\Exception $e) {
              return $e-&gt;getMessage();
          }
  
          return $response-&gt;getBody()-&gt;getContents();
      }
  </code></pre>
  <p>This code will get the token based on refresh</p>
  <pre><code>
      /**
       * Gets Token based upon users Refresh Token
       *
       * @param string $token Tinder access token
       *
       * @return array
       */
      public function getTokenFromRefreshToken($token)
      {
          $responseArray = $this-&gt;makePostRequest($token, '/v2/auth/login/sms');
  
          return $responseArray['data'];
      }
  
  </code></pre>
  <p>I am trying create video based on this. Thanks for the help in advance .</p>
  <p>I am stuck in the part where the frontend will make request to retrieve this token</p>