Error 403

error-codes

#1

Hi,

I am trying to send messages with 3 different twitter account simultaneously but Error 403 is occurring after every 4-5 direct messages.I am already using HTTPS.
Can you provide solution to resolve this problem?

Thanks.


#2

Please provide more information about what library you are using and how you are doing the requests.
Additionally please provide more error information, additionally to the HTTP error code, you usually get an error object as response.


#3

hi,
I am using tweetinvi library and request is- https://api.twitter.com/1.1/direct_messages/new.json?text=Please%20enter%20valid%20input!%200&user_id=xxxxxxxxxx


#4

Please provide us with the actual error message :slightly_smiling:
Error code 403 is just the HTTP error and according to the docs, there is a descriptive error message sent along with it:

The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why.


#5

I am sharing error message screenshot with you.
Kindly find the uploaded .jpg file.


#6

That is still missing the response body which should contain a JSON error object, describing the failure.


#7

First of all I’d encourage you to read our Automation Rules where we discourage automated DM posting.

If would be useful to see the JSON response containing the error.

If you are trying to post DMs too quickly from a single IP connection there’s a good chance that you are being throttled by our antispam technology which tries to avoid this kind of behaviour.


#8

Yeah that may be case because all the accounts are using same IP…
Thanks @ePirat & @andypiper.

I have one more doubt - I have two applications hosted in single account (i.e same owner)…Now if i want to send DMs (i.e direct message responces) by first application and 1000 messages limit exceeds then can I use second application to send the same response?


#9

No, that violates the Twitter Developer Terms of Service afaik.


#10

First of all, note that DM limits are per account, not per application. So, if you hit the daily limit for the account, you can’t get around it by simply using a different application.

Secondly, circumventing the rate limits by using multiple applications for the same purpose is against the Developer Policy. Please don’t do this, as it is unfair to others to attempt to use more resources than everyone else is permitted under the same system.


#11

Hello there,

Just in case the user is still interested to understand what exception he receives.

You can either disable the Exception Swallowing and your application will receive the TwitterException.

ExceptionHandler.SwallowWebExceptions = false;

Or you can catch all exceptions with the following event.

ExceptionHandler.WebExceptionReceived += (sender, args) =>
{
    // args.value contains all the information you want
    Console.WriteLine(args.Value);
};

Hope this help :slightly_smiling:

Cheers,
Linvi


#12

Hi,

I am using tweetinvi library to send DMs from a single account to different users but getting error 403

Forbidden - The request is understood, but it has been refused or access is not allowed.
An accompanying error message will explain why. This code is used when requests are being denied due to update limits.

It works fine, if DM is to a single user. It doesn’t give limit error even after 50+ DMs.