Android Twitter4j Getting Error While Retweet Or Send Message
Solution 1:
The stacktrace that you have provided contains a message which tells you what happened.
From the stacktrace:
403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (http://support.twitter.com/forums/10711/entries/15364)
The link provided in the message suggests that there are some API limits. Here is the message from the page:
Limits alleviate some of the strain on the behind-the-scenes part of Twitter, and reduce downtime and error pages. For the sake of reliability, we've placed some limits on account actions like following, API requests, direct messages, and updates.
Here is the breakdown of the various limits:
- Direct Messages: 250 per day.
- Updates: 1,000 per day. The daily update limit is further broken down into smaller limits for semi-hourly intervals. Retweets are counted as updates.
- Changes to Account Email: 4 per hour.
- Following (daily): Please note that this is a technical account limit only, and there are additional rules prohibiting aggressive following behavior. You can find detailed page describing following limits and prohibited behavior on the Follow Limits and Best Practices Page. The technical follow limit is 1,000 per day.
- Following (account-based): Once an account is following 2,000 other users, additional follow attempts are limited by account-specific ratios. The Follow Limits and Best Practices Page has more information.
Solution 2:
in my case i was getting this error cause the response was not just a JSON Object
but that was aJSON Array
and i was trying to conver it into JSONObject directly..
So the error is resolved now.
Thank You @nicholas your answer helped me alot..
Solution 3:
Recently I got the same error while executing similar code. To fix it, follow these steps:
- Go to https://apps.twitter.com/app/your_app_id
- Click on Keys and access token
- In Access Level, click modify app permission and choose the 3rd option: Read, Write and Access direct messages
- Click on update. ( Note: you might have to add your mobile no and verify with otp to get this access if you don't have your no added in twitter)
- Regenerate both Consumer key & secret and Access token & secret using the click-able button
And you are done! Your program will start working.
Post a Comment for "Android Twitter4j Getting Error While Retweet Or Send Message"