public static bool IsMessageSended(Message message, string token) { string url = new RequestUrlFactory(token, message.ChannelId, message.MessageText, message.UserId).SendMessage; string json = WebRequestUtility.GetContent(url); return(IsMessagesSendedFromJson(json)); }
public static ICollection <User> GetUsers(string token) { var url = new RequestUrlFactory(token); string json = WebRequestUtility.GetContent(url.UsersList); var users = GetUsersFromJson(json); return(users); }
public static ICollection <Channel> GetChannels(string token) { var url = new RequestUrlFactory(token); string json = WebRequestUtility.GetContent(url.ChannelsList); var auth = GetChannelsFromJson(json); return(auth); }
public static ICollection <Message> GetMessages(string token, string channelId, bool isChannelsMessages = false) { var factory = new RequestUrlFactory(token, channelId); string url = isChannelsMessages ? factory.ChannelHistory : factory.ImHistory; string json = WebRequestUtility.GetContent(url); var messages = GetMessagesInternal(json); return(messages); }
public static AuthResponse GetAuthResponse(string token) { if (token == null) { throw new ArgumentNullException(nameof(token)); } if (string.IsNullOrWhiteSpace(token)) { throw new ArgumentException(nameof(token)); } var url = new RequestUrlFactory(token); string json = WebRequestUtility.GetContent(url.Auth); var auth = GetAuthResponseFromJson(json); return(auth); }
public static ICollection <Im> GetIms(string token) { if (token == null) { throw new ArgumentNullException(nameof(token)); } if (string.IsNullOrWhiteSpace(token)) { throw new ArgumentException(nameof(token)); } var url = new RequestUrlFactory(token); string json = WebRequestUtility.GetContent(url.ImsList); var ims = GetImsFromJson(json); return(ims); }