我应该得到为每个用户的Instagram新的访问令牌 [英] should i get a new access token for every user instagram

查看:126
本文介绍了我应该得到为每个用户的Instagram新的访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将写有每user.should我得到为每个用户通过身份验证的访问令牌超过50个请求的应用程序?
以及如何用java做呢?我得到的API来处理,但如何获得访问令牌?

 类GetRequestAsyncTask扩展的AsyncTask<字符串,字符串,字符串> {
        @覆盖
        保护字符串doInBackground(字符串... URI){
            DefaultHttpClient http_client =新DefaultHttpClient();
            HTT presponse响应;
            串respondString;
            尝试{
                响应= http_client.execute(新HTTPGET(URI [0]));
                状态行状态行= response.getStatusLine();
                如果(statusLine.getStatus code()== HttpStatus.SC_OK){
                    ByteArrayOutputStream出=新ByteArrayOutputStream();
                    。response.getEntity()的writeTo(出);
                    respondString = out.toString();                    out.close();
                    Log.w(!标志,数据下载了:+ respondString);
                    返回respondString;
                }其他{
                    。response.getEntity()的getContent()close()方法。
                    抛出新IOException异常(statusLine.getReasonPhrase());
                }
            }赶上(ClientProtocolException E){
                Log.e(ClientProtocolException GetTask,e.toString());
                返回;
            }赶上(IOException异常五){
                Log.e(IOException异常GetTask,e.toString());
                返回;
            }
        }


解决方案

谁是这个用户?

如果你问你的用户登录到自己的Instagram帐户,并授权您的应用程序,那么你可以让每小时每个用户的请求5000:

http://instagram.com/developer/limits/

如果你只是用你的钥匙,你被限制为每小时5000的要求,不管你有多少用户。

I'm going to write an app that have more than 50 request for every user.should i get the access token for every user that Authenticated? and how to do it with java?i get the APIs with but how to get the access token?

class GetRequestAsyncTask extends AsyncTask<String, String, String> {
        @Override
        protected String doInBackground(String... uri) {
            DefaultHttpClient http_client = new DefaultHttpClient();
            HttpResponse response;
            String respondString;
            try {
                response = http_client.execute(new HttpGet(uri[0]));
                StatusLine statusLine = response.getStatusLine();
                if (statusLine.getStatusCode() == HttpStatus.SC_OK) {
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    response.getEntity().writeTo(out);
                    respondString = out.toString();

                    out.close();
                    Log.w("FLAG!", "Data downloaded:"+respondString);
                    return respondString;
                } else {
                    response.getEntity().getContent().close();
                    throw new IOException(statusLine.getReasonPhrase());
                }
            } catch (ClientProtocolException e) {
                Log.e("ClientProtocolException GetTask", e.toString());
                return "";
            } catch (IOException e) {
                Log.e("IOException GetTask", e.toString());
                return "";
            }
        } 

解决方案

Who are the users of this?

If you ask your users to log into their Instagram account, and authorize your app, then you can make 5000 requests per hour per user:

http://instagram.com/developer/limits/

If you just use your key, you are limited to 5000 requests per hour, no matter how many users you have.

这篇关于我应该得到为每个用户的Instagram新的访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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