C#Instagram-无效范围 [英] C# Instagram - Invalid Scope

查看:80
本文介绍了C#Instagram-无效范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个要显示Instagram帖子的网站.我需要access_token,所以我在遵循流程,尝试获取代码".一旦奏效,但再也不会...

I'm creating a site where I want to show Instagram posts. I need access_token, so I'm following the flow, trying to get "code" Once it worked, but never again...

消息始终是

"{" error_type":"OAuthException","code":400,"error_message":"invalid scope field:basic,user_profile,user_media"}"

"{"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一起使用时,出现相同的消息,无效的范围字段:基本

I've tried to remove scope line, then the error is Invalid scope field(s): basic When I used with scope=basic, same message, Invalid scope field(s): basic

我尝试使用Instagram clientID/令牌,相同的错误,尝试使用Facebookm中的Instagramm ID/秘密,相同的错误.

I've tried with Instagram clientID/token, same error, tried with Instagramm ID/Secret in Facebook App, same error.

也许有什么想法吗?

预先感谢

推荐答案

是的,今天(6月30日)不推荐使用该API.

Yeah, the API has been deprecated today (June 30th).

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

但正如@david在我面前写的那样,由于基本"字符权限被添加到任何请求中.

but as @david wrote before me, something is broken right now because the "basic" permission is added into any request.

更新2020年7月4日

已解决.必须从Facebook创建一个新的Instagram应用程序,然后用新的应用程序替换客户端ID,更新客户端密钥,更新呼叫URL,创建新的测试用户,更新令牌,并且通常更新整个代码,因为返回的结果来自.端点现在是完全不同的格式.不少工作.但是它现在正在工作.

Got it fixed. Had to create a new Instagram app from Facebook , then replace the client ID with the new one, update client secret, update the call URLs, create new test users, update the tokens, and generally update the entire code because the returned results from the endpoints are completely different format now. Quite some work. But it is working now.

这篇关于C#Instagram-无效范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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