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

New Post: Get help/configuration

$
0
0
Hi,

Yes it is not implemented because no one requested it until now. But as you just did, I added the Work Item to be available in the next release (0.9.6.0).

Work Item

In the meantime here is what you need to do.
  1. Reference Newtonsoft.Json in your project (use nuget, Install-Package Newtonsoft.Json).
  2. Create the following model representing the json of the configuration endpoint:
publicclass TwitterConfiguration
{
    [JsonProperty("characters_reserved_per_media")]
    publicint CharactersReservedPerMedia { get; privateset; }

    [JsonProperty("max_media_per_upload")]
    publicint MaxMediaPerUpload { get; privateset; }

    [JsonProperty("non_username_paths")]
    publicstring[] NonUsernamePaths { get; privateset; }

    [JsonProperty("photo_size_limit")]
    publicint PhotoSizeLimit { get; privateset; }

    [JsonProperty("photo_sizes")]
    public Dictionary<string, MediaEntitySize> PhotoSizes { get; privateset; }

    [JsonProperty("short_url_length")]
    publicint ShortURLLength { get; privateset; }

    [JsonProperty("short_url_length_https")]
    publicint ShortURLLengthHttps { get; privateset; }
}
  1. Invoke the endpoint:
var configuration = TwitterAccessor.ExecuteGETQuery<TwitterConfiguration>("https://api.twitter.com/1.1/help/configuration.json");
And here you go ;)
Regards,
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



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