0

I am trying, for the first time, to make a Java desktop app using Instagram Graph API. I am having trouble with a user logging in with their instagram account. The official Meta website only shows documentation to sign in for the Basic API, but I assumed it would work for the Graph API as well. My problem is that the authorization url is not working when I try. When I do the link I get error "{"error_type": "OAuthException", "code": 400, "error_message": "Invalid platform app"}".

On the website it says: "To begin the process, get the Authorization Window and present it to the user:

https://api.instagram.com/oauth/authorize?client_id={instagram-app-id}&redirect_uri={redirect-uri}&scope={scope}&response_type=code&state={state}"

So I made the url: https://api.instagram.com/oauth/authorize?client_id={id}&response_type=code&scope=user_profile&redirect_uri=https://google.com/

Of course, this gives me an error when loaded. According to the documentation, the user should get a code which the app will use to authenticate them. I have no idea why this link is not working.

According to other websites, it appears a Instagram Tester may need to be added to the app for this to work. Problem is in the app dashboard on the website, under App Roles -> Roles, there is no option for "Instagram Testers" specifically. The only product my app has is "Instagram Graph API" yet it shows nothing for Instagram Testers. I have also seen people talk about a place to put your redirect uri in the app dashboard, yet I have never found such a place. I'm not sure if that is the problem, or if it is something else. No answer online has helped me solve this issue.

5
  • IG Basic Display API and IG Graph API are two separate things. You need to implement the standard Facebook login, when working with the latter. developers.facebook.com/docs/instagram-api/…
    – CBroe
    Commented Aug 7, 2023 at 9:39
  • I just read somewhere that Facebook Login may be necessary to retrieve a user's business account data. Would the solution be to somehow use Facebook Login even though this is app will not be using Facebook? Much help needed, thanks.
    – jari85
    Commented Aug 7, 2023 at 9:40
  • I can't answer that right now, because I can't tell what you are actually trying to achieve.
    – CBroe
    Commented Aug 7, 2023 at 9:41
  • @CBroe I want a user to log into their instagram account so that the app can retrieve and store their posts. Using the Graph API, it appears Facebook login is the only way for a instagram user to log in. This seems a bit odd because that means the user must also have a Facebook account and a specific FB page. Do you know if there is any way around this? A way to log in only by insta, not by FB.
    – jari85
    Commented Aug 12, 2023 at 20:00
  • First you got to decide, whether you want to work with Business/ Creator accounts, or normal ones. For the former, you need to use the Instagram Graph API (those accounts need to be connected to a Facebook page, for login purposes), for the others you need to use the Instagram Basic Display API.
    – CBroe
    Commented Aug 14, 2023 at 5:38

0

Browse other questions tagged or ask your own question.