簡體   English   中英

無法從Instagram獲取訪問令牌

[英]Unable to get access token from instagram

我正在使用這個用於laravel 5.1的 instagram包裝程序包 我正在嘗試通過API連接到Instagram,然后使用

use Vinkla\Instagram\Facades\Instagram;
public function instagramlogin(Request $request)
{
    // Get code parameter.
    $code = $request->get('code');

    // Request the access token.
    $data = Instagram::getOAuthToken($code);

    // Set the access token with $data object.
    Instagram::setAccessToken($data);

    // We're done here - how easy was that, it just works!
    Instagram::getUserLikes();
    // This example is simple, and there are far more methods available.
}

然后可以訪問他/她的個人資料數據。 但我不斷收到錯誤消息

ErrorException in Instagram.php line 526:
Undefined property: stdClass::$access_token

如何認證用戶?

我解決了這個問題。 您基本上必須使用cosenary instagram軟件包,因為此軟件包是該軟件包的包裝。 因此,如果您遍歷cosenary軟件包的文檔並改用Facades,則功能將起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM