小程序关注公众号:我们如何在Android应用程序中关注/取消关注Instagram

关于小程序关注公众号的问题,在app follow unfollow instagram中经常遇到, 当我在 instagram 中使用 Follow / Unfollow API 时。我给我这样的错误。

当我在 instagram 中使用 Follow / Unfollow API 时。我给我这样的错误。

错误:

{"meta":{"error_type":"OAuthPermissionsException","code":400,"error_message":"This client has not been approved to access this resource."}}

我的 Post 方法调用在这里。

public static AllMessage postAction(String action, String UserID, String mAccessToken, DefaultHttp http) {
    AllMessage ReturnMessage = new AllMessage();
    String url = String.format(RELATIONSHIP_URL, new Object[]{UserID, mAccessToken});
    Log.v("log_tag", "FolURL " + url);
    try {
        HttpParams params = new BasicHttpParams();
        params.setParameter("http.protocol.version", HttpVersion.HTTP_1_1);
        params.setParameter("action=", action);
        if (http == null) {
            http = OpenHttpConnection();
        }
        HttpPost httpPost = new HttpPost(url);
        List<NameValuePair> arrayList = new ArrayList(2);
        arrayList.add(new BasicNameValuePair("action", action));
        httpPost.setHeader("Accept", "application/json");
        httpPost.setHeader("Content-type", String.valueOf(arrayList));
        UrlEncodedFormEntity ent = new UrlEncodedFormEntity(arrayList, "UTF-8");
        httpPost.setEntity(ent);
        String mHttpReturnedData = readInputStreamToString(http.execute(httpPost).getEntity().getContent());
        Log.v("log_tag", "Return " + mHttpReturnedData);
       } catch (Exception e4) {
        ReturnMessage.MessageType = "Unsupported Format";
        ReturnMessage.MessageError = "Unsupported data format Error -1000";
        ReturnMessage.ActionSucess = false;
        ReturnMessage.ActionID = 0;
        ReturnMessage.PrvAction = action;
    }
    return ReturnMessage;
}

请帮我这个代码。

0

您需要先注册您的应用才能使用Instagram API

The link is herehttps://www.instagram.com/developer/endpoints/

然后与端点https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=ACCESS_TOKEN通信并进行正确的调用。

目前没有一个Android SDK由他们,我听说过,但我很确定有一个第三方在那里。

希望有帮助。

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(164)
糖豆人哪个服务器人多:在棉花糖(果冻豆 奇巧 棒棒糖)下方的 Android浏览器中播放视频
上一篇
农村合作医疗小程序:AndroidWear:从应用程序获取医疗参数的 API
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(34条)