访问令牌没有被授权使用该范围关系令牌、范围、关系

2023-09-07 17:44:51 作者:老娘不死你永远是小三

我追加范围AUTH URL像这样>>>范围=喜欢+评论+关系+基础;

不过,虽然登录,它不要求用户的关系许可,只显示该应用程序可以接取你的照片。

里面每当我follwoing,或按unfollwing任何用户的应用程序

 字符串url="https://api.instagram.com/v1/users/"+userid+"/relationship/?access_token="+MainSingleTon.accesstoken;
            //键值对
            名单<的NameValuePair>的NameValuePair =新的ArrayList<的NameValuePair>(1);
            nameValuePair.add(新BasicNameValuePair(行动,取消关注));


            JSONObject的JSON = jParser.getJSONFromUrlByPost(URL,的NameValuePair);
 

我收到的JSON响应,

  {元:{ERROR_TYPE:OAuthPermissionsException,ERROR_MESSAGE:这个请求需要范围=的关系,但这种访问令牌没有被授权与此范围内的。用户必须重新授权使用范围=关系,你的应用程序被授予写权限,code:400}}
 

解决方案 如何为多个Web API提供授权方法

这是一个POST请求。为实现到InstagramAPI您需要提交您的申请资料和公司的细节,Instagram的审查职位的要求。也许其他关系,终端将正常工作没有提交你的应用程序。欲了解更多详情,请访问以下链接 https://instagram.com/developer/endpoints/relationships/# post_relationship

I am appending scope to auth url like this >>> scope=likes+comments+relationships+basic";

But while logging in, it is not asking user for relationship permission, only showing "this app can acess your photos".

Inside the application whenever i am follwoing or unfollwing any user by hitting

String url="https://api.instagram.com/v1/users/"+userid+"/relationship/?access_token="+MainSingleTon.accesstoken;
            // key and value pair
            List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(1);
            nameValuePair.add(new BasicNameValuePair("action","unfollow"));


            JSONObject json=jParser.getJSONFromUrlByPost(url, nameValuePair);

i am getting json response as

{"meta":{"error_type":"OAuthPermissionsException","error_message":"This request requires scope=relationships, but this access token is not authorized with this scope. The user must re-authorize your application with scope=relationships to be granted write permissions.","code":400}}

解决方案

This is a post request. To make post request to InstagramAPI you need to submit your application details and company details to Instagram for review. Maybe other relationship endpoints will work fine without submitting your app. For more details visit the following link https://instagram.com/developer/endpoints/relationships/#post_relationship