我正在尝试在网站上为客户显示图像库 . 这些图像应该自动从他们的Instagram帐户中提取 . 简单吧?好吧,它曾经是......
我可以't use the Instagram API, because it'被弃用:https://www.instagram.com/developer/
所以相反,我正在尝试使用Instagram Graph API来获取该帐户的最新图像:https://developers.facebook.com/docs/instagram-api/reference/user/media#get-media
跳到最低版本的底部,或继续阅读长版本 .
长篇故事
麻烦的是,我很难理解如何获得与此API交互的凭据 . 我可以说,我需要先创建四个单独的东西:
-
Instagram商业帐户(已完成)
-
Facebook用户(已完成)
-
Facebook页面(完成)
-
一个Facebook应用程序(完成... ish)
我'm not even sure if I need to create all of those things (especially the app), but that'我试图根据此页面找出我需要的权限:https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens
我认为我需要一个“应用程序访问令牌”,根据我的理解,我可以使用应用程序ID和应用程序秘密组合代替应用程序访问令牌,这实际上似乎有点工作 .
然后我尝试根据链接的Facebook页面获取我需要的Instagram ID,我使用此调用(使用真实的Facebook帐户ID和正确的令牌):https://graph.facebook.com/some-facebook-account-id-here?fields=instagram_business_account&access_token=something-here|and-here
对该电话的回应是:
{
"error": {
"message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "[redacted]"
}
}
然后我走了一个试图提交“功能”进行审查的兔子洞,但最终我遇到了一个捕获22,它要求我有一个我要求访问的东西的实时工作演示 . 当我甚至无法访问它时,我不明白我如何能够进行实时演示 .
长话短说
长话短说,这似乎非常复杂,应该非常简单 . 也许我只是做错了?
What would you do if you were in my shoes in order to gain access to the Instagram Graph API so that you can fetch a few images from a specific Instagram account to display on a website?
1 回答
现在,如果你想访问Instagram帖子,你有两个选择
使用Instagram Graph API对于企业帐户
使用Instagram Platform API用于非商业帐户
Assuming you have business account
这是link开始
Note:-
没有商业帐户Instagram仅支持基本许可
这就是他们对非商业账户的Instagram api所说的话
甚至在Facebook developers plateform他们说
Here是讨论它的SO线程,
So, in short, it's very hard to use APIs for Non-Business accounts