I'm migrating a project using 4.0.3 to last stable 5.0.3 and this code:
TwitterClient client = new TwitterClient(ApiKey, AppSecret, AccessToken, AccessTokenSecret);
var user = client.Users.GetUserAsync(toIdentifier).Result; // toIdentifier is a string with my user's name "dbesoli"
long sendTo = user.Id;
var result = client.Messages.PublishMessageAsync(new PublishMessageParameters("hello", sendTo));
string tweetId=result.Result.Id; // <<==== exception line
is causing this AggregateException with the following InnerException:
{
Reason : "Unsupported Media Type",
Details : "(0)",
Code : 415,
Date : "26/11/2020 12:28:22 +00:00",
URL : "https://api.twitter.com/1.1/direct_messages/events/new.json"
Twitter documentation description :""
}
With previous version it works fine to send PM to this user. I've tried PublishMessageAsync without PublishMessageParameters like: client.Messages.PublishMessageAsync("hola", sendTo); with no success
I'm migrating a project using 4.0.3 to last stable 5.0.3 and this code:
is causing this
AggregateExceptionwith the followingInnerException:With previous version it works fine to send PM to this user. I've tried PublishMessageAsync without PublishMessageParameters like: client.Messages.PublishMessageAsync("hola", sendTo); with no success