Instagram API : How to obtain an access token

标签 instagram instagram-api

我需要创建一个 PHP 应用程序,在给定主题标签的情况下,它会向我返回一个 XML,其中包含与该主题标签相关的帖子。

我在开发者部分登录 Instagram 并填写了应用程序设置表格。

已生成“客户端 ID”和“客户端 key ”,但我在任何地方都没有看到生成的 token 访问。

其中一个字段要求“有效重定向 URI:”,但应用程序尚未开始完成,它将全部在本地主机上开发,然后才会在托管提供商中发布。

在这种情况下,我该如何开发我的功能?我需要做什么才能获得 Instagram 授予的访问权限?

我找到了一个在线工具,您可以通过它输入客户端 ID 和客户端 key ,然后它会返回访问 token 。

但是,结果是:{"error_type": "OAuthException", "code": 400, "error_message": "重定向 URI 与注册的重定向 URI 不匹配"}

最佳答案

最近(上周)Instagram 已停止接受新应用程序的提交,这就是您在创建新的访问 token 时遇到此问题的原因。 https://techcrunch.com/2018/04/02/instagram-api-limit/

尽管对于已经注册的应用程序,您仍然可以通过添加额外的新用户来获得更多访问 token 。

https://developers.facebook.com/blog/post/2018/03/26/facebook-platform-changes/

暂停应用审核:我们上周暂停了应用审核,同时对平台实现了新的更改。

<小时/>

https://www.instagram.com/developer/authentication

Receiving an access_token

In order to receive an access_token, you must do the following:

  1. Direct the user to our authorization url.

    • If the user is not logged in, they will be asked to log in.
    • The user will be asked if they would like to grant your application access to her Instagram data.
  2. The server will redirect the user in one of two ways that you choose:

    • Server-side flow (recommended): Redirect the user to a URI of your choice. Take the provided code parameter and exchange it for an access_token by POSTing the code to our access_token url.

    • Implicit flow: Instead of handling a code, we include the access_token as a fragment (#) in the URL. This method is less secure, but allows applications without any server component to receive an access_token.

希望对您有帮助

关于Instagram API : How to obtain an access token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49650813/

相关文章:

ios - 我如何从照片库中获取最后一张照片的路径?

javascript - 无法从 Shopify 调用 instagram API

android - Instagram API查看没有access_token的公共(public)用户照片

instagram - 2016 年 6 月 1 日政策变更后获得 Instagram 关注者

ios - crino/instagram-ios-sdk - 重定向 URI 与注册的重定向 URI 不匹配

ios - 使用 Instagram API 获取特定的用户名数据

instagram-api - 如何从 instagram 共享 url 获取直接 URL

facebook-graph-api - 新的 Instagram Graph API 上的标签搜索媒体在哪里?

java - 通过 API 调用从 Instagram 注销

ios - 将 UIDocumentInteractionController 与 UIActivityController 结合起来分享到 Instagram、Facebook、邮件、消息等