TweetInvi and Filtered Streams

193 views Asked by At

Just trying to do some basic testing of the Twitter API.

I've generate my keys/secrets and a bearer token, and been able to do simple Get/Create/Updates fine using the TweetInvi package.

However, I'm just totally stuck at how to get the Filtered Stream working to monitor for at mentions?

I have something like this:

var userClient = new TwitterClient(consumerKey, consumerSecret, accessToken, accessTokenSecret);

var stream = userClient.Streams.CreateFilteredStream();

stream.AddTrack("@AccountToFilterBy");

stream.MatchingTweetReceived += (sender, eventReceived) =>
{
   // do some stuff
};

await stream.StartMatchingAnyConditionAsync();

This just won't work for me, I get a 403 error each time. I've tried just passing the consumer key/secret, using the client id key/secret (as I don't really know what it's for) and also added in the Bearer token as well to see if that helps, but just keep getting 403 error each time.

Has anyone got this working, was there a breaking change for TweetInvi as I can't find much info on it?

1

There are 1 answers

0
nihnih On

I am getting the same error, but I do not believe it is related to TweetInvi lib. For example, using Postman Twitter API when you create a tweet, it works. But it gives me same 403 error for for sampled or filtered stream using Postman Twitter API. I think it has to do with twitter permissions.