使用web api在Instagram上传媒体帖子

时间:2017-12-21 05:51:49

标签: php codeigniter authentication instagram-api

我正在使用this Instagram媒体发布第三方库。当我每次获得检查点(挑战)所需的错误时登录我的Instagram帐户时如何解决此问题。

这是登录代码:

try 
{
    $response = $this->request('accounts/login/')
            ->setNeedsAuth(false)
            ->addPost('phone_id', $this->phone_id)
            ->addPost('_csrftoken', $this->client->getToken())
            ->addPost('username', $this->username)
            ->addPost('adid', $this->advertising_id)
            ->addPost('guid', $this->uuid)
            ->addPost('device_id', $this->device_id)
            ->addPost('password', $this->password)
            ->addPost('login_attempt_count', 0)
            ->getResponse(new Response\LoginResponse());
}
catch (\InstagramAPI\Exception\InstagramException $e) 
{
    if ($e->hasResponse() && $e->getResponse()->isTwoFactorRequired()) 
    {
        // Login failed because two-factor login is required.
        // Return server response to tell user they need 2-factor.
        return $e->getResponse();
    } 
    else 
    {
        // Login failed for some other reason... Re-throw error.
        throw $e;
    }
}

您可以找到有关此here的更多详细信息:

错误回复:

  

消息:“checkpoint_required”,   checkpoint_url:“https://i.instagram.com/challenge/6193546568/K2IwuBF47k/”,   锁:是的,   状态:“失败”,   error_type:“checkpoint_challenge_required”

如果你有任何其他方式的Instagram媒体发布,那么你可以建议我。

1 个答案:

答案 0 :(得分:0)

以上特定错误看起来像我特定的帐户。 Instagram在检测到帐户上的恶意活动时会锁定帐户,撤消访问令牌,您需要再次登录才能解锁帐户。他们称之为安全检查点。像你这样的东西试图通过VPN或其他东西从其他国家访问帐户。或者尝试了多次错误密码。