【问题标题】:Instagram Api with package python-instagram change scope带有包 python-instagram 更改范围的 Instagram Api
【发布时间】:2014-10-15 08:34:50
【问题描述】:

我使用了python-instagram,我想更改范围,但使用包python-instagram 我不知道怎么做?我看到了代码,但我没有找到我们可以在哪里更改它?

我需要更改范围以添加“关系”范围,因为我有一个错误:

错误:(400) OAuthPermissionsException - 此请求需要范围 = 关系,但此访问令牌未通过此授权 范围。用户必须重新授权您的应用程序 scope=relationships 被授予写入权限。

【问题讨论】:

    标签: python api scope instagram instagram-api


    【解决方案1】:

    当您授权您的应用并获取访问令牌时,您需要声明范围。您可以通过创建这样的 URL 来授权您的应用程序/获取令牌:

    https://instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize?scope={relationships comments likes}&redirect_uri={redirect uri}&response_type=code&client_id={client id}
    

    只需在范围参数中传入范围即可。

    【讨论】:

    • 我得到了这个错误而不是{"code": 400, "error_type": "OAuthException", "error_message": "You must include a valid client_id, response_type, and redirect_uri parameters"}这是我使用的链接:https://instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize?scope=public_content&redirect_uri=http://localhost&response_type=code&client_id={client id}我可以保证客户端ID是有效的。
    【解决方案2】:

    您需要征得 Instagram 的许可才能使用这些范围:关系、cmets 和点赞。这是提交您的许可请求时必须填写的表格链接。

    https://help.instagram.com/contact/185819881608116

    希望你得到你想要的。

    【讨论】:

      【解决方案3】:

      在 2015 年 11 月 17 日之后,Instagram 中的很多权限都非常受限。您必须提交获得该范围的许可请求。请参考以下链接:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-08-09
        相关资源
        最近更新 更多