public Task <T> PostFeedItemAsync <T>(FeedItemInput feedItemInput, string userId) { // Feed items not available post v30.0 if (float.Parse(_jsonHttpClient.GetApiVersion().Substring(1)) > 30.0) { return(_jsonHttpClient.HttpPostAsync <T>(feedItemInput, "chatter/feed-elements")); } return(_jsonHttpClient.HttpPostAsync <T>(feedItemInput, string.Format("chatter/feeds/news/{0}/{1}", userId, _itemsOrElements))); }
public ChatterClient(string instanceUrl, string accessToken, string apiVersion, HttpClient httpClient) { _jsonHttpClient = new JsonHttpClient(instanceUrl, apiVersion, accessToken, httpClient); // A change in endpoint for feed item was introduced in v31 of the API. _itemsOrElements = float.Parse(_jsonHttpClient.GetApiVersion().Substring(1)) > 30 ? "feed-elements" : "feed-items"; }