Hello,
We are currently using the Twitter API TweetSharp v 2.3.1 in our application, and we are facing an issue when retrieving posts (tweets and direct messages) that contain animated Gifs/MP4.
For example when we try to get the list of the DMs using this code below:
TwitterService twitterService = new TwitterService(consumerKey, consumerSecret, accessToken, accessTokenSecret);
ListDirectMessagesReceivedOptions directMessageOptions = new ListDirectMessagesReceivedOptions { SinceId = twitterAccount.SinceId, MaxId = maxId };
var directMessages = twitterService.ListDirectMessagesReceived(directMessageOptions);
The following exception is raised:
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type ‘TweetSharp.TwitterDirectMessage’ because the type requires a JSON object (e.g. {“name”:“value”}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {“name”:“value”}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Here is a more detailed exception message :
Exception:Thrown: “Error converting value “animated_gif” to type ‘TweetSharp.TwitterMediaType’. Path ‘entities.media[0].type’, line 132, position 30.” (Newtonsoft.Json.JsonSerializationException)
A Newtonsoft.Json.JsonSerializationException was thrown: “Error converting value “animated_gif” to type ‘TweetSharp.TwitterMediaType’. Path ‘entities.media[0].type’, line 132, position 30.”
Indeed, the media type is unknown. When we open the Tweetsharp reference in the Object Browser, we only find “photo” media type.

Are we missing anything?
Thank you for your help