Esteban Etayo Gil
Esteban Etayo Gil

Reputation: 61

Twitter4J, Direct Messages

I have a problem with the twitter API. I created an app for Android using the Twitter4J library, I managed to log users correctly, check your timeline, mentions, profile data, but I have problems accessing your direct messages.

All time jumps me the following error:

Error en actualizar:DirectMessagesActivity 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 ([Link][1]).

message - This application is not allowed to access or delete your direct messages.

code - 93

Relevant discussions can be found on the Internet at here. or here.

TwitterException`{exceptionCode=[00919618-14e73985], statusCode=403, message=This application is not allowed to access or delete your direct messages., code=93, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=12, limit=15, resetTimeInSeconds=1392219303, secondsUntilReset=122}, version=3.0.5}`

I've checked 1 and 1000 times I have permissions to access the DM. I have regenerated the token, I created a new APP from 0 in your administration console ... but I'm not able to fix this problem.

Any help will be very imporant to me.

Thank you very much!​

Upvotes: 1

Views: 1180

Answers (1)

Prabin
Prabin

Reputation: 71

Recently i got the same error while executing the code. To fix it, please follow the below steps:

  1. https://apps.twitter.com/app/{your_app_id}
  2. Click on Keys and access token.
  3. In Access Level, click modify app permission and choose the 3rd option: Read, Write and Access direct messages.
  4. Click on update. ( Note: you might have to add your mobile no and verify with otp to get this access if you dont have your no added in twitter).
  5. Regenerate both Consumer key & secretand Access token & secret using the clickable button.

The above steps worked for me and I hope it will be useful for you as well.

Upvotes: 4

Related Questions