Getting error in twitter app (DM automatic implementation) on verified twitter account

directmessages
tweetinvi

#1

We have developed an automatic DM twitter application and added it in verified twitter account. With this app’s access keys we are trying to use twitter public API’s/through Tweetinvi. but for every call we are getting below error, while debugging we found that it is not even verifying loggedin user(using access keys). We tried to create new app, regenerate access keys but nothing is working for us.
Error -

Error converting value xxxxxxxx to type 'System.Collections.
Generic.IEnumerable`1[System.Int64]'. Path 'user_id', line 4, position 23.
Could not cast or convert from System.Int64 to System.Collections.Generic.IEnume
rable`1[System.Int64].

Exception StackTrace:    at Newtonsoft.Json.Serialization.JsonSerializerInternal
Reader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonCont
ract contract, Type targetType)

We are getting this error only for specific twitter account and not for all.
This account is a verified twitter account, but for other verified twitter accounts (even for non-verified) our application is working fine.

Kindly assist.


#2

From the error shown here, it looks like something in the JSONified user object being returned contains a user_id field which Tweetinvi is having issues with. Are you able to trace out any more information about the user object for comparison with others that work? Are you able to share the specific user ID that is causing problems?

Note that if you application is posting automated DMs you should carefully review the automation rules.


#3

Thanks Andy for your reply. We traced out more info about error as below -
code: “FOLLOWS_OVER_LIMIT”,
message: “The requested user follows more accounts than the maximum supported by this streaming endpoint. Only a subset of 10000 followed accounts are included in this stream.”,

For following limits we have read below article now -

But is there any way for verified account to allow “following count” more than 10k?
As for our particular account we have around 0.5 million followers and a/c is following 12k users.
Kindly advise.


#4

What that message is telling you is that the streaming endpoint cannot deliver more information about the user’s followed accounts. It should not affect your ability in code to send a direct message as that user. If the user you’re trying to message is not following the user you’re trying to send from, you’ll get an error which you can gracefully handle. I don’t understand why the streaming message here would be blocking you otherwise. You can learn more about the streaming message types in the documentation.


#5

Hello I am the main developer Tweetinvi,

I would be interested to have more information concerning your problem.
I would like to replicate your problem and fix it for other developers who could face it in the future.

Could we get in contact via gitter or github.

Thank you for your help.


#6

Hi TweetinviApi,

I investigated a bit in tweetinvi solution and founded that actual error is coming from function TryRaiseTooMuchFollowerWarning in class UserStream of Tweetinvi.Streams project.

As our account had more followers that is why this error was coming.

Can you suggest any solution for this. As we cannot reduce number of followers.

Currently I had commented the code which is raising this error, other functionalities are working fine.


#7

Hello,

I do not personally own any account that would allow me to reproduce the problem.
Do you think you could share temporary credentials for me to access the account and debug this problem?

You can contact me privately on gitter at https://gitter.im/linvi/tweetinvi.

Note that I opened a bug on github : https://github.com/linvi/tweetinvi/issues/498

Thank you


#8

This issue has now been fixed in Tweetinvi 1.3.

You can install 1.3-alpha from nuget at https://www.nuget.org/packages/TweetinviAPI/1.3.0-alpha