Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: "At least one of the arguments provided to the query was invalid." Error

$
0
0
It seems that after trying numerous different ways to get back information on a tweet just recreated with PublishTweet(text), I keep getting the above error.
The basic code is:
var credentials = TwitterCredentials.CreateCredentials(sa.AccessToken, sa.AccessTokenSecret, s.PublicKey, s.PrivateKey);
ILoggedUser user = Tweetinvi.User.GetLoggedUser(credentials);
ITweet results = user.PublishTweet(txtTweet.Text);
Looking deeper into the stacktrace I see:
[ArgumentException: At least one of the arguments provided to the query was invalid.]
   Tweetinvi.Credentials.TwitterAccessor.ExecuteMultipartQuery(String query, HttpMethod method, IEnumerable`1 medias) +127
   Tweetinvi.Credentials.TwitterAccessor.ExecutePOSTMultipartQuery(String query, IEnumerable`1 medias, JsonConverter[] converters) +77
   Tweetinvi.Controllers.Tweet.TweetQueryExecutor.PublishTweet(ITweetDTO tweetToPublish) +141
   Tweetinvi.Controllers.Tweet.TweetController.PublishTweet(ITweet tweetToPublish) +167
   Tweetinvi.Logic.<>c__DisplayClass62.<PublishTweet>b__61() +69
   Tweetinvi.Logic.LoggedUser.StartLoggedUserOperation(Func`1 operation) +79
   Tweetinvi.Logic.LoggedUser.PublishTweet(ITweet tweet) +175
   Tweetinvi.Logic.LoggedUser.PublishTweet(String text) +90
   Admin_TestTweet.btnTweet_Clicked(Object sender, EventArgs e) in c:\Users\mikeg the\documents\over the top\controlpanel\V3\super-admin\Tests\Tweet.aspx.cs:228
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615682
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
My goal here is examine results to get the unique ID of this tweet as well as to determine if it succeed in getting posted. In the examples above, yes, the post went through, it appears that it choked on trying to push values into the ITweet.

I can, however, get the tweets to go through without throwing any exceptions if I use the following (which doesn't give me back ANY information that is usable):
var credentials = TwitterCredentials.CreateCredentials(sa.AccessToken, sa.AccessTokenSecret, s.PublicKey, s.PrivateKey);
TwitterCredentials.ExecuteOperationWithCredentials(credentials, () => { Tweet.PublishTweet(txtTweet.Text); });
Any thoughts on why this is happening? I really like what I'm seeing so far but need to get to the bottom of this.

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>