C# Instagram - 无效范围

标签 c# oauth instagram

我正在创建一个网站,我想在其中显示 Instagram 帖子。 我需要 access_token,所以我正在按照流程尝试获取“代码” 一旦它起作用,但再也不会...

消息总是

"{"error_type": "OAuthException", "code": 400, "error_message": "Invalid scope field(s): basic,user_profile,user_media"}"

string authUri = "https://api.instagram.com/oauth/authorize/?client_id=" + _clientID +
                    "&redirect_uri=" + redirectUri +
                    "&scope=user_profile,user_media" +
                    "&response_type=code";

        Process.Start(authUri);

我试图删除范围行,然后错误是无效的范围字段:基本 当我使用 scope=basic 时,相同的消息,无效的范围字段:basic

我尝试使用 Instagram clientID/token,同样的错误,在 Facebook App 中尝试使用 Instagramm ID/Secret,同样的错误。

有什么想法吗?

提前致谢

最佳答案

是的,该 API 已于今天(6 月 30 日)弃用。

网址应为 https://www.instagram.com/oauth/authorize/?client_id=CLIENTID&redirect_uri=REDIRECTURI&response_type=code&scope=instagram_graph_user_media

但正如@david 在我之前写的那样,现在有些东西坏了,因为“基本”权限被添加到任何请求中。

2020 年 7 月 4 日更新

修好了。不得不从 Facebook 创建一个新的 Instagram 应用程序,然后用新的客户端 ID 替换客户端 ID,更新客户端密码,更新调用 URL,创建新的测试用户,更新 token ,并且通常更新整个代码,因为返回的结果来自端点现在是完全不同的格式。相当多的工作。但它现在正在运行。

关于C# Instagram - 无效范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62647917/

相关文章:

c# - 在编写单元测试时断言 "nothing happened"

c# - CryptoStream:为什么使用 CryptoStreamMode.Write 进行加密,而使用 CryptoStreamMode.Read 进行解密?

javascript - C# Web 浏览器 Instagram 登录页面未加载

c# - 将 mm/dd/yyyy 转换为 JsonDate 格式

c# - 使用原始参数构造函数注册类型?

javascript - 401 错误时 Angular 2 刷新访问 token 并重复初始请求

python-3.x - 如何在 selenium python 中按回车键?

instagram - 如何从 Instagram 中的媒体检索评论?

oauth - 有什么方法可以结合客户端和服务器端 Google API 身份验证?

oauth - 为什么要对 Authorization header 进行 base64 编码?