Building an App as an Agent for Slack with .NET

Learning Slack APIs

Configuring Access for your app to Slack APIs

Consuming Slack APIs from .NET App

// initializing REST Client
var slackClient = new SlackTaskClient(_slackUserToken);

var response = await slackClient.TestAuthAsync();
if (response.ok)
{
// showing channels
RefreshAvailableChannels();
}
private async Task RefreshAvailableChannels()
{
try
{
var conversationsResponse = await this._taskClient.GetConversationsListAsync(string.Empty, true, 1000);
if (conversationsResponse.ok)
{
var convos = conversationsResponse.channels.Where(c => c.is_member == true).ToList();

this.slackChannels.ItemsSource = convos;
}
}
catch
{

}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store