“无效的平台应用程序"使用 Instagram Basic Display API 时出错 [英] "Invalid platform app" error using Instagram Basic Display API

查看:30
本文介绍了“无效的平台应用程序"使用 Instagram Basic Display API 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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":无效的平台应用"}

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

我正在执行此处提到的所有步骤 ->https://developers.facebook.com/docs/instagram-basic-display-api/getting-started 是的,我正在使用 Instagram 应用程序 ID,这是 Products -> 中的客户端机密.Instagram ->显示,下面是我发送请求的网址

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,

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

推荐答案

交换代码时需要使用 POST 请求.

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

从您的 url 的外观来看,您已将其构造为 GET 请求,其中所有参数都作为 url 的一部分而不是表单数据.尝试将参数作为帖子正文的一部分发送

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

这篇关于“无效的平台应用程序"使用 Instagram Basic Display API 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆