I am using Instagram API for my application. I need access to the feed of private users whom I am following, but the response is:
code: 400
error_type: APINotAllowedError
error_message: you cannot view this resource
I could not find anything in the documentation regarding this. I was hoping that as I am able to see the user's feed on my app, I would be able to retrieve the same using the API.
Any way around this? Please help.
[As instagram changes their api, this tips may not work forever]
I faced same issue and the cause is it happens when the posts are private , even if user access token is passed with endpoints this errors happen.
Solution: just in place of userid use 'self' for private profile. means if a profile has private posts then who connects should be the same person of the profile and other person can not view his/her posts.
Example:
https://api.instagram.com/v1/users/USER_ID/media/recent/?access_token=USER_ACCESS_TOKEN_HERE if this endpoints shows error then use https://api.instagram.com/v1/users/self/media/recent/?access_token=USER_ACCESS_TOKEN_HERE
(just replace 'userid' with 'self')
来源:https://stackoverflow.com/questions/23600510/instagram-api-getting-feed-of-private-user-whom-the-authorised-user-follows