0
我想從twitter api獲取個人資料圖片。無法獲取twitter個人資料圖片的用戶api 1.1
我試過以下方法。
一)按照這個網址:Twitter4j authentication credentials are missing和Retrieve the user profile image from twitter
//Twitter Conf.
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey(CONSUMER_KEY)
.setOAuthConsumerSecret(CONSUMER_SECRET)
.setOAuthAccessToken(ACCESS_KEY)
.setOAuthAccessTokenSecret(ACCESS_SECRET);
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
User user = twitter.showUser(id of other user who using same app);
user.getOriginalProfileImageURL()
在這種方法
得到異常
08-29 09:05:26.282: W/System.err(3823): 404:The URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the requested format is not supported by the requested method.
08-29 09:05:26.282: W/System.err(3823): message - Sorry, that page does not exist.
二)按照這個最新網址
https://dev.twitter.com/docs/api/1.1/get/users/profile_banner
通用戶的屏幕名稱在這裏:
https://api.twitter.com/1.1/users/profile_banner.json?screen_name=iRohitSachdeva
響應:{「errors」:[{「message」:「Bad Authentication data」,「code」:215}]}。