Instagram基本显示API:如何检查用户的Instagram帐户是公共帐户还是私人帐户? [英] Instagram Basic Display API: How to check if user's Instagram account is public or private?

查看:229
本文介绍了Instagram基本显示API:如何检查用户的Instagram帐户是公共帐户还是私人帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook昨天向我发送了警报:

Facebook sent me an alert yesterday:

" 作为改善我们平台整体隐私的持续更改的一部分,我们最近对平台条款和开发者政策进行了更改.我们还对使用Instagram Basic Display API的应用程序的访问令牌刷新进行了更改.

自2020年8月31日起,使用Instagram基本显示API的开发人员将不再能够继续访问私有Instagram帐户信息,而无需获得该帐户的重新授权.调用GET/refresh_access_token API终结点的应用在为私有Instagram帐户调用终结点时将不会收到刷新的访问令牌.

此更改将要求私有Instagram帐户至少每60天重新授权一次,以便开发人员能够使用Instagram Basic Display API继续访问其当前数据.此项更改仅适用于Instagram私人帐户;使用此API端点访问公共Instagram帐户的数据的权限将保持不变."

据我所知,对于私人帐户,如果其访问令牌已过期,我将无法再使用API​​ GET/refresh_access_token 刷新令牌,但必须从头开始重新授权令牌

So in my understanding, for private account, if its access token is expired, I cannot use the API GET /refresh_access_token to refresh the token anymore but I have to re-authorize the token from scratch.

在这种情况下,如何检查用户的Instagram帐户是公共帐户还是私人帐户?我在 Instagram基本显示API doc;也许我错过了某件事...

In this case, how can I check if user's Instagram account is public or private? I did not find anything related to this on Instagram Basic Display API doc; or perhaps I missed something...

如果有人能在这个问题上为我提供帮助,我将不胜感激.

I would be truly grateful if someone can shed a light for me on this matter.

推荐答案

由于我不知道如何识别帐户是公共帐户还是私有帐户,因此我只向他们应用了API GET/refresh_access_token 全部.对于公共帐户,它工作正常,但对于私人帐户,它将返回一个错误对象:

Since I had no idea how to identify if an account is public or private, I just applied the API GET /refresh_access_token to them all. It works fine for public accounts, but for private ones, it will return an error object:

{
    "error": {
        "message": "Application does not have permission for this action",
        "type": "OAuthException",
        "code": 10,
        "error_subcode": 2207054,
        "is_transient": false,
        "error_user_title": "Permission Denied",
        "error_user_msg": "You cannot refresh access tokens for Instagram private accounts. To generate a new access token, reauthorize the user as documented here https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-access-tokens-and-permissions\"",
        "fbtrace_id": "#####"
    }
}

因此,一旦识别出私人帐户,就可以轻松地对其进行重新授权.

So once private account is identified, it is easy to apply re-authorization to it.

这篇关于Instagram基本显示API:如何检查用户的Instagram帐户是公共帐户还是私人帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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