Instagram Graph API [英] Instagram Graph API
问题描述
我的任务是使用Instagram Graph API获取我的业务Instagram帐户的照片数据.我遵循了Instagram Graph API的说明- https://developers.facebook.com/docs/instagram-api/参考/用户/媒体 ,表示要求类似
My task is to get photo data of my business Instagram account with Instagram Graph API. I followed the instruction from Instagram Graph API - https://developers.facebook.com/docs/instagram-api/reference/user/media , which said request like
GET http://graph.facebook.com/17841405822304914/media
可以从JSON格式链接到FB帐户的Instagram帐户获取照片数据.
can get photo data from the Instagram account linked to the FB account in JSON format.
我尝试使用FB开发人员平台上的Graph API Explorer发送文档中所述的GET request /my_facebook_id/media
,但是它未能返回我想要的数据.
这是我得到的错误:
I tried to send GET request /my_facebook_id/media
as said by the document with Graph API Explorer on FB developer platform but it failed to return the data I want.
This is the error I got:
消息:尝试访问节点类型(用户)上不存在的字段(媒体) 类型:OAuthException代码:100
message: Tried accessing nonexisting field (media) on node type (User) type: OAuthException code: 100
该消息是否表示FB用户中不存在媒体字段?
Does the message mean the media field doesn't exist in the FB user?
错误代码100的含义是什么?我什至在FB官方文件中都看不到它.
What is the meanIng of error code 100? I can't even see that in FB official document.
我尝试为此请求使用Instagram企业帐户ID,但收到一条错误消息,提示用户对象不存在
I tried to use the Instagram business account ID for this request but I got an error message said the user object doesn't exist
如何完成任务?谢谢!
推荐答案
我想您错过了创建Facebook企业页面并将其Instagram企业帐户与其链接的机会.
I guess you have missed creating a Facebook business page and linking your Instagram Business account to it.
以下是设置指南: https://developers.facebook. com/docs/instagram-api/getting-started
如果此操作正确完成,但您仍然面临错误,原因是Facebook错误导致您的帐户无法正确链接.
If this was done correctly and still you're facing the error is because of a Facebook bug where your account doesn't get linked correctly.
此处: https://developers.facebook.com/support/bugs/177912116363088/?disable_redirect = 0
解决方案:请断开您的Instagram帐户与页面的连接.然后,在Instagram应用上,设置后,您将不得不切换回个人帐户并重新转换为企业帐户
Solution : Please disconnect your Instagram account from your page. Then, on Instagram app, in setting you will have to switch back to personal account and reconvert to a business account
注意:切换到个人帐户,您将失去媒体的见识.
Note : Switching to a personal account you will lose the insights of your media.
完成此操作后,您应该可以获取instagram_business_account并发布,您可以运行查询来获取媒体:
Once this is done you should be able to get instagram_business_account and post which you can run your query to fetch the media :
GET http://graph.facebook.com/you-instagram-business-account-id/media
这篇关于Instagram Graph API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!