Search code examples
phpapifacebook-graph-apifacebook-appsinstagram-graph-api

"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,


Solution

  • 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