WEBVTT

00:00.080 --> 00:00.920
Okay.

00:00.960 --> 00:02.880
Welcome to Slack Time.

00:03.000 --> 00:10.920
We are now going to do our third and most hardcore integration to the business messaging platform slack.

00:11.440 --> 00:17.920
And you would need to have a workspace, a slack workspace where you have admin permissions to set up

00:17.920 --> 00:19.560
an app, which you might not do.

00:19.680 --> 00:22.840
And if you don't, then just follow along and see what I do.

00:22.880 --> 00:27.360
As a way of getting some experience with OAuth two types of integrations.

00:27.360 --> 00:30.040
If you do, then maybe make one with me.

00:30.440 --> 00:35.680
But here I am in my my own workspace where I have admin permissions because I have this admin thing

00:35.680 --> 00:36.160
here.

00:36.160 --> 00:41.440
And the first thing I'm going to do is go down to apps and workflows and select this, which is where

00:41.440 --> 00:47.840
we go into the app side of slack, because we are going to set up a slack app and slack bot.

00:47.880 --> 00:48.280
Okay.

00:48.280 --> 00:54.760
And so when I press this up comes a web browser and it's on this page here installed apps, and you'll

00:54.760 --> 00:59.800
see a couple of apps that are installed in my workspace, which is my previous attempts to do this.

00:59.840 --> 01:04.450
I've now done it twice successfully, but with with much, uh, much frustration.

01:04.450 --> 01:07.370
But but I did make it work, and so can you.

01:07.730 --> 01:08.130
All right.

01:08.130 --> 01:09.210
The first thing to know.

01:09.250 --> 01:11.970
And sometimes this takes me ages to remember.

01:11.970 --> 01:12.890
This is where it is.

01:13.010 --> 01:14.290
Is that on the top right.

01:14.290 --> 01:15.530
Here you go.

01:15.570 --> 01:16.130
You see that?

01:16.130 --> 01:18.050
There's this navigation over here.

01:18.050 --> 01:20.930
And the first step is to go to build over here.

01:21.090 --> 01:23.610
Uh, so you go over to build.

01:23.610 --> 01:29.570
And when you do that, you come to this screen, which is where there's a screen with a create new app

01:29.570 --> 01:30.170
button.

01:30.210 --> 01:35.410
And that's the one to do create a new app and you select from scratch.

01:35.850 --> 01:36.850
Choose that.

01:36.890 --> 01:38.370
You give it a name.

01:38.370 --> 01:43.930
And this is where I'm going to give it a name of Nate N3 because this is my third time.

01:44.170 --> 01:44.970
All right.

01:44.970 --> 01:46.650
So far so good okay.

01:46.690 --> 01:51.770
And then select a workspace and you have one and then create app.

01:52.170 --> 01:52.970
Here we go.

01:53.010 --> 01:54.890
It's created an app.

01:55.130 --> 01:57.210
And there's stuff in here.

01:57.570 --> 02:00.970
And there's a lot a lot to to to navigate.

02:00.970 --> 02:06.980
There's tons of stuff over here that we are going to be be working on now as we go through this, and

02:06.980 --> 02:11.100
we're going to need to know many of these IDs, because many of them we're going to need to be setting

02:11.100 --> 02:14.340
up when we come to Na ten.

02:14.980 --> 02:16.260
So let's get started.

02:16.300 --> 02:22.300
The first place to go, and perhaps the single most important one is this one OAuth and permissions,

02:22.300 --> 02:23.420
which is where we'll head now.

02:23.460 --> 02:25.300
Okay OAuth and permissions.

02:25.420 --> 02:26.300
Up it comes.

02:26.580 --> 02:32.540
So what we're going to need to do is first of all uh set up what's called scopes.

02:32.580 --> 02:37.460
Now scopes is a standard feature of of this this technology OAuth.

02:37.500 --> 02:43.020
This way that that applications can authenticate themselves against another application.

02:43.060 --> 02:47.860
And scope is saying what is someone entitled to do if they connect this way.

02:48.140 --> 02:55.660
And we have to add in different OAuth scopes for our bot that governs what our app is able to do.

02:55.860 --> 02:59.180
So we're going to click here add OAuth scopes.

02:59.180 --> 03:04.240
And this is where you'll see a large number of different things that we could say our bot is going to

03:04.240 --> 03:09.800
be allowed to do, and I'm going to just show you what the six things are that we need it to be able

03:09.800 --> 03:11.440
to do, and you're just going to put them in.

03:11.560 --> 03:16.240
And I discovered these by not having enough in there and having problems and then coming back and adding

03:16.240 --> 03:16.680
them in.

03:16.680 --> 03:19.680
But there are probably better ways to discover exactly what you need.

03:19.680 --> 03:23.640
But the first one I'm going to do is called app Mentions read.

03:23.640 --> 03:27.560
And as you start typing it filters so you can select it as it says.

03:27.560 --> 03:35.280
That means that that hour is going to be able to read messages directly that that we tag the app in.

03:35.280 --> 03:37.360
So that is done okay.

03:37.400 --> 03:39.520
And now we go to scopes and we press add again.

03:39.520 --> 03:40.480
And we're going to add some more.

03:40.480 --> 03:45.000
We're going to add channels history this one right here okay.

03:45.200 --> 03:46.680
And then we press the add again.

03:46.680 --> 03:48.920
And we're going to do channels read.

03:49.880 --> 03:50.640
Fine.

03:50.760 --> 03:51.480
So far so good.

03:51.480 --> 03:52.240
We're halfway.

03:52.440 --> 03:54.680
We're going to say chat right.

03:54.680 --> 03:58.120
That means it can send messages as and three for you.

03:58.160 --> 03:59.640
It will just be Na ten I imagine.

04:00.280 --> 04:04.850
And now we're going to have Um, I am colon history.

04:04.850 --> 04:11.290
I am colon history, which means that it can view messages that others that in any channels that Nan

04:11.330 --> 04:12.330
has been added to.

04:12.690 --> 04:18.930
And then the last one is going to be users colon read view the people in a workspace.

04:18.970 --> 04:20.650
Okay there we go.

04:20.690 --> 04:24.090
We've set all of these scopes that are going to be permitted.

04:24.370 --> 04:29.330
And then we have to press this install to add button which will be installed to.

04:29.330 --> 04:34.770
And then the name of your workspace, which is saying that that this is now going to allow this OAuth

04:34.770 --> 04:35.650
integration.

04:35.650 --> 04:37.130
So I press that button.

04:37.170 --> 04:38.130
Stuff happens.

04:38.170 --> 04:41.130
Allow NH3 app to access slack.

04:41.410 --> 04:42.690
And you say allow.

04:43.010 --> 04:45.250
And that should happen.

04:45.410 --> 04:46.730
And that has been created.

04:46.730 --> 04:50.730
And we now have this bot user token.

04:50.730 --> 04:53.530
That's a big deal to have that okay.

04:53.730 --> 04:54.490
Onwards.

04:54.690 --> 05:00.090
The other section that we have to look at is the next one down event subscriptions.

05:00.330 --> 05:02.940
So you select this Okay.

05:03.100 --> 05:04.460
What is this about?

05:04.540 --> 05:06.620
So this is how we tell slack.

05:06.820 --> 05:14.180
There are some situations when we are going to want you to make a call out to a call out externally,

05:14.380 --> 05:15.780
like it's going to call a trigger.

05:16.060 --> 05:18.300
Uh, and so we're going to turn this on.

05:18.340 --> 05:24.700
We want to enable events, and we are going to tell uh, slack where it should go.

05:24.740 --> 05:30.820
We're going to give it a URL, which it should hit in order to wake up N810 and say, hey, N810, something

05:30.820 --> 05:34.500
is coming in from slack and we will come back to that.

05:34.860 --> 05:40.540
But we also have to tell it what what events, what things do we want to happen in slack that should

05:40.540 --> 05:41.460
trigger this?

05:41.500 --> 05:48.460
And that's where we say subscribe to bot events and we click Add Bot User Event right here.

05:48.580 --> 05:56.900
And we're going to do app underscore mention subscribe only to the message events that mention your

05:56.900 --> 05:58.180
app or bot.

05:58.740 --> 05:59.340
Okay.

05:59.660 --> 06:00.620
That is what we've done.

06:00.620 --> 06:03.190
We've we've put in this the subscription in here.

06:03.190 --> 06:04.550
And we've turned this on.

06:04.990 --> 06:06.790
We've put in place some of the plumbing.

06:06.790 --> 06:08.630
It's time to go to Nw10.

06:08.790 --> 06:09.590
All right.

06:09.830 --> 06:11.510
It's time for us to do this.

06:11.510 --> 06:14.910
So first up we have to press the Create Workflow button.

06:14.910 --> 06:17.350
And we come in here and we add a first step.

06:17.350 --> 06:22.230
We type slack and it's going to be a trigger.

06:22.390 --> 06:26.390
And we're going to want to trigger on bot app mention.

06:26.750 --> 06:27.870
That's what we want.

06:27.910 --> 06:28.830
Let's do it.

06:29.270 --> 06:30.590
Select credential.

06:30.590 --> 06:32.430
Create a new credential.

06:32.430 --> 06:37.870
Always the first step first thing to do is to put in an access token.

06:37.870 --> 06:39.470
So what is this going to be.

06:39.470 --> 06:41.870
Well for this we need to go back to slack again.

06:41.870 --> 06:43.470
So here we are back in slack.

06:43.470 --> 06:45.350
We're on our ten three.

06:45.390 --> 06:47.310
We're in our apps.

06:47.630 --> 06:50.750
And we're going to go back to OAuth and permissions.

06:50.990 --> 06:54.430
And this is the bot user OAuth token.

06:54.430 --> 06:56.270
And we're going to copy this.

06:56.670 --> 06:57.750
Uh okay.

06:58.110 --> 06:59.990
Now we're going to go back to here.

06:59.990 --> 07:04.440
We're going to go in here and paste that key in there and press save.

07:04.880 --> 07:07.840
Testing connection tested successfully.

07:07.840 --> 07:09.680
That's an important first step.

07:10.120 --> 07:11.960
Now look, there is another thing you can do too.

07:12.000 --> 07:17.440
You can put in a signature secret here, which it does recommend that you do to make the interaction

07:17.440 --> 07:18.280
more secure.

07:18.400 --> 07:25.760
And if you want to do that, then you can you come into here, you go to the basic information and you

07:25.760 --> 07:29.480
can add in a, you can copy the signing secret and put it in there.

07:29.480 --> 07:32.960
But I found I had technical problems with this, so I'm not going to do it.

07:32.960 --> 07:37.520
But if you want to, you can it will give you that extra level of security and you might have to debug

07:37.520 --> 07:39.240
it if it doesn't work at first.

07:39.680 --> 07:40.240
Okay.

07:40.400 --> 07:41.200
So back we go.

07:41.200 --> 07:45.640
Now here let's let's continue to set up this trigger.

07:45.880 --> 07:46.720
All right.

07:46.720 --> 07:49.960
So now we're going to go back back here again.

07:50.200 --> 07:55.920
And we are going to select which channel we want to watch.

07:56.240 --> 07:58.320
That is the important next step.

07:58.520 --> 08:01.080
And before we do that we'll have to go back to slack.

08:01.280 --> 08:07.740
All right so here we are back in slack again, and I'm going to create a new channel by uh, going to

08:07.860 --> 08:11.500
uh, to, to you can see Ngn3 has appeared as a new app.

08:11.500 --> 08:17.100
By the way, I'm going to go to channels, go here and say create a channel, and I'm going to call

08:17.100 --> 08:23.100
this convo three because I've had a few of these already, but you can just call your channel convo

08:23.100 --> 08:28.780
or whatever you want next, and then I'm just going to I'm going to leave it as a public channel for

08:28.780 --> 08:30.700
for this workspace and press create.

08:30.700 --> 08:32.820
And there is convo three.

08:33.180 --> 08:37.060
And now you can choose to invite people to convo three.

08:37.220 --> 08:41.540
I'm going to I'm going to skip for now because we're going to do it right here and now within the convo

08:41.540 --> 08:46.460
three channel I'm going to do slash invite at Nan3.

08:46.660 --> 08:52.380
That is how I invite the uh, the bot and and three into this channel.

08:52.700 --> 08:53.460
It's there.

08:53.820 --> 08:55.620
Okay, one more thing I'm going to do.

08:55.620 --> 09:00.100
I'm going to go up here to the triple dots to the more actions.

09:00.100 --> 09:04.390
I'm going to click in this and I'm going to go to Edit Edit Settings.

09:04.630 --> 09:06.550
And these are the settings for this channel.

09:06.550 --> 09:08.350
And I'm going to scroll down.

09:08.550 --> 09:13.470
And somewhere here I am going to see I think it's under about sorry under about.

09:13.510 --> 09:14.390
Here it is.

09:14.430 --> 09:18.750
There is a channel ID and I'm going to copy that to the clipboard.

09:19.350 --> 09:20.710
It took me a while to find that.

09:20.710 --> 09:21.310
So there we go.

09:21.350 --> 09:23.830
We have the channel ID copied to the clipboard.

09:23.870 --> 09:25.110
Are you following all this.

09:25.110 --> 09:28.270
So we've now got the channel ID to convo three in the clipboard.

09:28.270 --> 09:32.670
Convo three this channel has the bot n8 m3 in it.

09:32.830 --> 09:35.030
Now back to N810.

09:35.310 --> 09:36.630
Here we are back at N810.

09:36.670 --> 09:37.870
You're getting dizzy from this.

09:37.910 --> 09:39.750
It's one way and the other way.

09:40.230 --> 09:42.070
Select the channel to watch.

09:42.190 --> 09:49.470
We go to the drop down here we say by ID and in here we paste that channel ID that we've just done.

09:49.710 --> 09:57.030
And there we have now, uh, selected this this channel as, as uh, the right channel to be listening

09:57.070 --> 09:57.430
to.

09:58.190 --> 10:01.630
Okay, there's one more step and it's a pretty big one.

10:01.630 --> 10:03.990
And we're going to do that in the next video.
