Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Invalid platform app" error using Instagram Basic Display API

I am trying to use Instagram Basic display API but when I post the authorization code to get the access token I keep getting the following error

{"error_type": "OAuthException", "code": 400, "error_message": "Invalid platform app"}

I am following all the steps mentioned here -> https://developers.facebook.com/docs/instagram-basic-display-api/getting-started and Yes I am using the Instagram app ID and It's client secret which is in Products -> Instagram -> Display and following is the URL I am sending the request

"https://api.instagram.com/oauth/access_token?client_id=".$app_id."&client_secret=".$app_secret."&grant_type=authorization_code&redirect_uri=".$redirecturi."&code=".$code,

like image 649
Danish Ali Malik Avatar asked Feb 17 '20 08:02

Danish Ali Malik


People also ask

How do you get the basic display API access token on Instagram?

1. You can access the token generator in the App Dashboard > Products > Instagram > Basic Display tab. 2. Scroll down to User Token Generator and click on Generate Token next to your account.

What is Instagram API access?

The Instagram Basic Display API allows users of your app to get basic profile information, photos, and videos in their Instagram accounts. The API can be used to access any type of Instagram account but only provides read-access to basic data.

Does Instagram API still work?

In 2018, Instagram shut down its public API. Meaning, third-party apps can no longer access the API from Instagram without permission. Third-party apps now need to be approved by Instagram before they can access the API.

Did Instagram change their API?

Instagram announced a depreciation of the Basic Permission for its Legacy API Platform. Update: Instagram made the API change on the 29th of June, 2020 and not on the initially announced date – 2nd of March, 2020.


3 Answers

I ran into this same issue. Problem was I was using the Facebook App ID and App Secret instead of the Instagram App ID & App Secret. You must go to the "Instagram Basic Display" section on the Facebook developers site then scroll down until you find the Instagram App ID & Secret.

like image 88
Blane Townsend Avatar answered Oct 03 '22 01:10

Blane Townsend


If you are using Postman, do remember it's a POST request. Use form data

enter image description here

like image 34
Emeka Mbah Avatar answered Oct 03 '22 01:10

Emeka Mbah


When you exchange the code you need to use a POST request.

From the looks of your url, you've formed it as a GET request with all the parameters as part of the url rather than as form data. Try sending the parameters as part of the post body instead

like image 25
TommyBs Avatar answered Oct 03 '22 00:10

TommyBs