使用facebook graph api获取Instagram自己/自己的Feed [英] Get instagram own/self feed with facebook graph api

查看:232
本文介绍了使用facebook graph api获取Instagram自己/自己的Feed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用instagram API/Graph API很新,但是找不到我的问题的答案.

I'm quite new using instagram API/Graph API but I can't find answers to my questions.

由于不赞成使用Instagram API,所以现在我们必须处理instagram/facebook图形API.

Since Instagram API is deprecated, now we have to deal with instagram/facebook graph API.

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

I am aware of the new procedure (https://developers.facebook.com/docs/instagram-api/getting-started/ ) that consist of:

  • 将Facebook页面连接到Instagram企业帐户.
  • 注册您的应用.
  • 添加Facebook登录产品.
  • 添加Instagram API产品.
  • 使用Graph API资源管理器测试您的应用设置.
  • 提交您的应用以供应用审核.

问题是我只希望自己获得自己的instagram feed.

但默认情况下,最低API权限为 instagram_basic 此权限必须必须先由Facebook审核,然后再获得授予.

But by default, the minimum API permission is instagram_basic This permission must be reviewed by facebook before beeing granted.

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

And to be reviewed we must provide (as a screencast):

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

如此处所述

但是对于我的用例,我没有要显示的东西,因为我只想对自己的供稿进行后端处理.

But for my use case I don't have such things to show as I just want to do backend processing for my own feed.

我的问题是:

  1. 图形API允许吗?
  2. 我是否想念某些东西,例如instagram的一种App令牌? (例如: https://developers.facebook.com/docs/facebook-login/access-tokens?locale = zh_CN#apptokens )
  3. 有解决方法吗?

感谢您的时间和贡献.

推荐答案

Facebook评论非常烦人,几乎不可能通过.但是我设法做到了自己想要的:得到我自己的Instagram提要.我是用Facebook Javascript SDK制作的.

Facebook reviews are pretty annoying and mostly impossible to go through. But I managed to make exactly what you want: get my own Instagram's feed. I made it with Facebook Javascript SDK.

首先要记住的是,必须使用您使用的浏览器登录Facebook帐户.否则,您应该添加登录代码(如果需要,我可以在此处输入).

The first thing you should keep in mind is that you must be logged in your Facebook's account with the browser you are using. Otherwise, you should add the login code (I can put in here if you need it).

在完成将您的Facebook帐户与Instagram关联的所有步骤之后(获取 appID ):

After all the steps about connect your Facebook account with your Instagram (getting the 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)
  }
});

希望有帮助!

这篇关于使用facebook graph api获取Instagram自己/自己的Feed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆