13

My question is very similar to this one.

The Instagram app that I am working on is in SandBox Mode

In my app I first get public_content permission to get the necessary info I need.
But when I am trying to get the info of a private account that the authenticated user follows, I get an APINotAllowedError error

This is the API endpoint that I am trying to access: https://api.instagram.com/v1/users/PRIVATE_PROFILE/media/recent/?access_token=TOKEN_OF_USER_THAT_FOLLOWS_PRIVATE_PROFILE

Both of the accounts are invited to the sandbox app, and I can get the recent media from the private account if i set it to public, using the same code.

Is this how the API is supposed to work, because you should be able to get the info of a private user from a user that follows him.

Community
  • 1
  • 1
FastFarm
  • 409
  • 1
  • 6
  • 21
  • could be a bug with sandbox mode for private profiles, check on http://gramfeed.com and see if u can login as that user and access the private profile – krisrak Dec 19 '15 at 20:22
  • I have checked on gramfeed.com and other websites like iconsquare.com and I can indeed access the private profile. I submitted a bug report 3 days or so ago, but I still no reply. – FastFarm Dec 19 '15 at 20:24

2 Answers2

5

Use the GET relationship endpoint.

https://api.instagram.com/v1/users/user-id/relationship

This endpoint returns a BOOL value “target_user_is_private”.

or try this out

You can use the User Media endpoint with client_id:

https://api.instagram.com/v1/users/USER_ID/media/recent/?client_id=YOUR-CLIENT_ID

If the user is private you will get a response like this:

{"meta":{"error_type":"APINotAllowedError","code":400,"error_message":"you cannot view this resource"}}

If the user is public, then you will get API response with "code":200 with user recent media data – "data":[...]

youngdero
  • 382
  • 2
  • 16
  • 3
    As you have said in your own answer, this does not help me with private profiles. What I am asking is how to get the data or recent pictures or anything at all of a private user, using an authentication token of a user that follows the private user – FastFarm Dec 21 '15 at 15:38
1

First of all this is not an answer for the question, I do not have enough reputation to give you a comment. All information about a private user is not accessible, we will get their very less detail using there user ID. I have faced same situation, I do not have code with me now. You can read this > General terms > point 15.(no codes, just to point out the private data accessibility)

Sinto
  • 3,915
  • 11
  • 36
  • 70
  • I don't think that you are correct. The way private profiles work is that they only allow users that are following them to see the photos and other content that they create. There are websites like gramfeed.com which offer this functionality, i.e. they show you all the pictures that you have liked, including the ones of private profiles. – FastFarm Dec 28 '15 at 12:17
  • Can you pls check this : https://api.instagram.com/v1/users//{user-id}/follows/?client_id={client_id} This will give you followers details. Instagram ref:https://www.instagram.com/developer/endpoints/relationships/ – Sinto Dec 29 '15 at 03:28