使用facebook graph api获取Instagram自己/自我饲料

问题描述 投票:5回答:2

我使用Instagram API / Graph API很新,但我无法找到问题的答案。

由于Instagram API已被弃用,现在我们必须处理instagram / facebook图形API。

我知道新程序(https://developers.facebook.com/docs/instagram-api/getting-started/)包括:

  • 将Facebook页面连接到Instagram企业帐户。
  • 注册您的应用。
  • 添加Facebook登录产品。
  • 添加Instagram API产品。
  • 使用Graph API Explorer测试您的应用程序设置。
  • 提交您的应用程序以进行App Review。

问题是我只希望能够获得自己的Instagram Feed。

但默认情况下,最低API权限为instagram_basic此权限必须在获得授权之前由facebook审核。

要进行审核,我们必须提供(作为截屏视频):

  • 企业如何使用Facebook登录以连接他们的Instagram个人资料
  • 企业如何在您的应用中看到此功能

As described here

但是对于我的用例,我没有显示这样的东西,因为我只想为自己的Feed做后端处理。

我的问题是:

  1. 图API是否允许这样做?
  2. 我是否会错过一些东西,比如Instagram的一种App令牌? (喜欢:https://developers.facebook.com/docs/facebook-login/access-tokens?locale=en_US#apptokens
  3. 有解决方法吗?

感谢您的时间和贡献。

facebook facebook-graph-api instagram instagram-api feed
2个回答
0
投票

如果您是页面所有者和应用程序的开发人员,则应该无需审核即可运行。


0
投票

Facebook的评论非常烦人,而且几乎无法通过。但我设法做出你想要的东西:获得我自己的Instagram的饲料。我用Facebook Javascript SDK制作了它。

您应该记住的第一件事是您必须使用您正在使用的浏览器登录Facebook的帐户。否则,您应该添加登录代码(如果需要,我可以放在这里)。

完成关于将您的Facebook帐户与Instagram连接的所有步骤(获取appID):

参考Facebook Javascript SDK

<script async src="https://connect.facebook.net/es_ES/sdk.js"></script>

初始Facebook

FB.init({
  appId: "your_app_id",
  autoLogAppEvents: true,
  xfbml: true,
  version: "v3.1"
});

如果你有联系(非常重要):

FB.getLoginStatus(function (response) { // Check login status
  if (response.status === "connected") {
    FB.api(
      "/" + your_facebook_page_id + "/",
      "GET", { "fields": "instagram_business_account" }, // Get Instagram's account ID
      function (response) {
        FB.api(
          "/" + response.instagram_business_account.id + "/media", // Get Instagram's media
          "GET", { "fields": "shortcode" }, // In this case, only shortcode
          function (response) {
            // Do something with the data
          }
        );
      }
    );
  } else {
    console.log("Error recovering access token: Not connected.")
    console.log(response)
  }
});

希望能帮助到你!

© www.soinside.com 2019 - 2024. All rights reserved.