title: Upload media post in instagram using web api
body: <p>I am using <a href="https://github.com/mgp25/Instagram-API" rel="nofollow noreferrer">this</a> <code>Instagram</code> media post third party library. When I am logged in in my Instagram account every time I am getting a checkpoint (challenge) required error how can I fix this issue. </p>
  
  <p><strong>This is the login code:</strong></p>
  
  <pre><code>try 
  {
      $response = $this-&gt;request('accounts/login/')
              -&gt;setNeedsAuth(false)
              -&gt;addPost('phone_id', $this-&gt;phone_id)
              -&gt;addPost('_csrftoken', $this-&gt;client-&gt;getToken())
              -&gt;addPost('username', $this-&gt;username)
              -&gt;addPost('adid', $this-&gt;advertising_id)
              -&gt;addPost('guid', $this-&gt;uuid)
              -&gt;addPost('device_id', $this-&gt;device_id)
              -&gt;addPost('password', $this-&gt;password)
              -&gt;addPost('login_attempt_count', 0)
              -&gt;getResponse(new Response\LoginResponse());
  }
  catch (\InstagramAPI\Exception\InstagramException $e) 
  {
      if ($e-&gt;hasResponse() &amp;&amp; $e-&gt;getResponse()-&gt;isTwoFactorRequired()) 
      {
          // Login failed because two-factor login is required.
          // Return server response to tell user they need 2-factor.
          return $e-&gt;getResponse();
      } 
      else 
      {
          // Login failed for some other reason... Re-throw error.
          throw $e;
      }
  }
  </code></pre>
  
  <p>You can find more detail about this <a href="https://github.com/mgp25/Instagram-API/blob/master/src/Instagram.php" rel="nofollow noreferrer">here</a> : </p>
  
  <p><strong>Error Response:</strong></p>
  
  <blockquote>
    <p>message: "checkpoint_required",
    checkpoint_url: "<a href="https://i.instagram.com/challenge/6193546568/K2IwuBF47k/" rel="nofollow noreferrer">https://i.instagram.com/challenge/6193546568/K2IwuBF47k/</a>",
    lock: true,
    status: "fail",
    error_type: "checkpoint_challenge_required"</p>
  </blockquote>
  
  <p>If you have any other way of Instagram media post then you can suggest me.</p>