403:The request is understood, but it has been refused Twitter Android
Asked Answered
S

5

18

I am trying to tweet on twitter from android. Now for this i have create an application on dev.twitter and downloaded sample code from this link and update both keys with my app keys.

Now i run the code authenticate the account and after it i tweet and this tweet includes image and text both image was on URL as define in sample code. Now i first time it shows me image and text successfully uploaded but when i try to again tweet it gives me 403 status update error.

For this i change the text message "status Text" and image URL but still it is giving me "403 status" update error. I have the same code as written in sample code only keys are changed.

Here is my Logcat:

10-04 11:26:25.015: W/System.err(22822): 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 (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
10-04 11:26:25.015: W/System.err(22822): message - Error creating status.
10-04 11:26:25.015: W/System.err(22822): code - 189
10-04 11:26:25.025: W/System.err(22822): Relevant discussions can be found on the Internet at:
10-04 11:26:25.025: W/System.err(22822):    http://www.google.co.jp/search?q=b2b52c28 or
10-04 11:26:25.025: W/System.err(22822):    http://www.google.co.jp/search?q=11331d43
10-04 11:26:25.025: W/System.err(22822): TwitterException{exceptionCode=[b2b52c28-11331d43], statusCode=403, message=Error creating status., code=189, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
10-04 11:26:25.025: W/System.err(22822):    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
10-04 11:26:25.025: W/System.err(22822):    at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
10-04 11:26:25.025: W/System.err(22822):    at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98)
10-04 11:26:25.030: W/System.err(22822):    at twitter4j.TwitterImpl.post(TwitterImpl.java:1871)
10-04 11:26:25.030: W/System.err(22822):    at twitter4j.TwitterImpl.updateStatus(TwitterImpl.java:252)
10-04 11:26:25.030: W/System.err(22822):    at chintan.khetiya.android.Twitter_code.Twitt_Sharing.Share_Pic_Text_Titter(Twitt_Sharing.java:126)
10-04 11:26:25.030: W/System.err(22822):    at chintan.khetiya.android.Twitter_code.Twitt_Sharing$PostTwittTask.doInBackground(Twitt_Sharing.java:91)
10-04 11:26:25.030: W/System.err(22822):    at chintan.khetiya.android.Twitter_code.Twitt_Sharing$PostTwittTask.doInBackground(Twitt_Sharing.java:1)
10-04 11:26:25.030: W/System.err(22822):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
10-04 11:26:25.035: W/System.err(22822):    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
10-04 11:26:25.035: W/System.err(22822):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
10-04 11:26:25.040: W/System.err(22822):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
10-04 11:26:25.040: W/System.err(22822):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
10-04 11:26:25.040: W/System.err(22822):    at java.lang.Thread.run(Thread.java:856)
Suprarenal answered 4/10, 2013 at 6:38 Comment(6)
Seems like you have reached limits... thats what this log sayingCamala
@Camala i have tweet only one time and tried next time. Even as mentioned on sites that 1000 tweets are allowedSuprarenal
try this link londatiga.net/it/how-to-send-image-to-twitpic-from-androidCamala
api use in this project no longer supportedSuprarenal
api use in this project no longer supported and it requires api v 1.1 at that time api v 3 is in useSuprarenal
@Suprarenal the code works perfectly for me. Only I had to reset my emulator time as it was showing wrong one. Check this out..Graner
B
36

I had this same error and upgrading to the latest version of twitter4j 3.0.5 (at the time of this writing) fixed the issue.

Get the latest here http://twitter4j.org/en/index.html#download

EDIT: I should mention that the version i was running was twitter4j 3.0.3. So by going to version 3.0.5 or 3.0.6 fixed the issue for me.

Breskin answered 17/1, 2014 at 0:5 Comment(4)
great this is perfect solutionTantalic
Thanks. ran into the same issue and updating the lib helped. Dont know the reason for issue in the 3.0.3 version though.Timmytimocracy
@erdomester Hi my friend. I have the same issue on 4.0.1. I'm using twitter4j within this library. github.com/antonkrasov/AndroidSocialNetworks Can you share me if you could fix it.Haff
as I'm using twitter4j-core-4.0.4-javadoc.jar in my eclipse i won't acceptingPernas
D
0

in

ConfigurationBuilder cb = new ConfigurationBuilder();

add cb.setUseSSL(true)

it will work

redirect url ssl required make sure your application running on https.

Deason answered 31/12, 2014 at 7:33 Comment(1)
for authentication you would have create ConfigurationBuilder object there you should add cb.setUseSSL(true)Deason
D
0

I encountered this error when I wanted to share an image with a wrong a url. Turned out I set the wrong folder in the url, Twitter didn't find the image thus throw an error. Question is, why do they show this error instead of something like "wrong url".

You may also run into this error when your are trying to post a longer text. I ran into this when I wanted to share a text (124 characters) and a link (10) characters and it didn't let me post it.

Depolymerize answered 7/3, 2015 at 10:41 Comment(0)
T
0

Found this problem again in the non-stable version 4.0.6.

Try not using maven in the way is specified in twitteer4j's website, which is this:

 <dependencies>
      <dependency>
           <groupId>org.twitter4j</groupId>
           <artifactId>twitter4j-core</artifactId>
           <version>[4.0,)</version>
       </dependency>
       ...
   </dependencies>

Instead, put an specific version (current stable is 4.0.4 and fix this problem, but [4.0,) gets the newest from 4.0, so 4.0.6)

 <dependencies>
      <dependency>
           <groupId>org.twitter4j</groupId>
           <artifactId>twitter4j-core</artifactId>
           <version>4.0.4</version>
       </dependency>
       ...
   </dependencies>
Text answered 29/7, 2017 at 11:37 Comment(0)
P
0

When you have 403:The request is understood, but it has been refused you also have error code that explain what exactly was wrong. It helped me understand the reason.

Explanation for error codes you can see here: https://developer.twitter.com/en/support/twitter-api/error-troubleshooting

Portent answered 28/10, 2020 at 8:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.