Instagram Basic Display API: How to check if user's Instagram account is public or private?

前端 未结 1 1797
野趣味
野趣味 2021-01-25 06:12

Facebook sent me an alert yesterday:

"As part of ongoing changes to improve overall privacy of our Platform we recently made changes to our Platform Terms and De

相关标签:
1条回答
  • 2021-01-25 06:55

    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.

    0 讨论(0)
提交回复
热议问题