Exemplo n.º 1
0
        public async Task <IActionResult> Channels()
        {
            var queryString = _queryStringFactory.CreateQueryString(_slackConfiguration);

            var result = await _restClient.GetAsync <ChannelListResponse>(_slackConfiguration.ApiUrl, SlackUriConstants.ChannelsList, queryString);

            return(Ok(result.Channels));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> UserInfo(string userId)
        {
            var queryString = _queryStringFactory.CreateQueryString(_slackConfiguration, userId);

            var userInfo = await _restClient.GetAsync <UserInfoResponse>(_slackConfiguration.ApiUrl, SlackUriConstants.UserInfo, queryString);

            if (userInfo.Ok)
            {
                return(Ok(userInfo.User));
            }

            return(NotFound(userId));
        }