【问题标题】:How to get User Followers in Instagram API?如何在 Instagram API 中获取用户关注者?
【发布时间】:2015-06-17 06:44:21
【问题描述】:

我正在使用 instagram API(oauth),我能够使用获取访问令牌和用户信息

https://api.instagram.com/oauth/authorize/client_id='.$client_id.'&redirect_uri='.$redirect_url .'&response_type=code'

https://api.instagram.com/oauth/access_token 通过传递客户端ID、秘密和redirect_uri。

当我打第一个电话时 (https://api.instagram.com/oauth/authorize/client_id='.$client_id.'&redirect_uri='.$redirect_url .'&response_type=code') 它给了我 access_token 和 user 的数组。

我的问题是我应该怎么做才能获得用户的关注者?

我知道我必须使用https://api.instagram.com/v1/users/{user-id}/follows?access_token=ACCESS-TOKEN,但由于某种原因我收到了错误消息

{
 "code": 400, 
 "error_type": "OAuthException", 
 "error_message": "Only response type \"code\" and \"token\" is allowed"
}

请帮忙!!!

【问题讨论】:

    标签: php api oauth instagram-api


    【解决方案1】:

    首先,您无需经过身份验证(即需要access_token)即可获取用户关注者列表。你只需要你的client_id

    以下请求应该适用于您的情况:

    https://api.instagram.com/v1/users/{user-id}/follows/?client_id={client_id}

    【讨论】:

      【解决方案2】:

      根据新更新,您必须使用访问令牌而不是 client_id

      这是我的回应 {"data": {"id": "1829538552", "username": "mypageusername", "profile_picture": "@987654321@", "full_name": "pagename Nation", "bio": "For Business/Ads\add@gmail.com\nKik: @test", "website": "@987654322@", "counts": {"media": 371, "follows": 6464, "followed_by": 171599}}, "meta": {"code": 200}}

      这是获取上述响应的网址 @987654323@

      您必须获得访问令牌,并且您只能检查接受您的沙盒用户的用户的关注者列表

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-11
        • 2019-03-07
        • 2017-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多