1
00:00:03,140 --> 00:00:08,990
So we created this first API in our first module of this course,

2
00:00:09,020 --> 00:00:13,940
now what do we have here, what are all these menu items on the left about

3
00:00:13,940 --> 00:00:17,300
and how does this API actually work?

4
00:00:17,300 --> 00:00:23,720
If you remember the first module, what we did is we clicked actions, create resource and then create method

5
00:00:23,990 --> 00:00:26,630
to create this resource and this method.

6
00:00:26,840 --> 00:00:30,450
If we check out this method, we see this strange thing on the right,

7
00:00:30,470 --> 00:00:35,420
I'll come back to this. For now I want to focus on what we did,

8
00:00:35,420 --> 00:00:41,810
we worked here under resources, we clicked create method resource and so on and as you can see, we

9
00:00:41,820 --> 00:00:43,850
got a lot of different actions.

10
00:00:43,850 --> 00:00:49,760
So under resources, we indeed managed the resources and methods of our API

11
00:00:50,000 --> 00:00:55,130
and important, resource, a resource is just like a path like this,

12
00:00:55,130 --> 00:01:01,020
so if you create a new resource, you create a new path in the final URL you can use.

13
00:01:01,140 --> 00:01:03,330
There is one important application.

14
00:01:03,470 --> 00:01:07,910
I said we do work here, we do add new resources and methods

15
00:01:07,910 --> 00:01:15,220
and this of course also has to mean that whatever we do here in resources isn't live,

16
00:01:15,230 --> 00:01:21,340
this isn't our live API. To bring it to life and expose it to the web,

17
00:01:21,500 --> 00:01:28,940
we always have to call deploy API here. Until we do that, all our changes here will not be reflected in

18
00:01:28,940 --> 00:01:29,690
the web,

19
00:01:29,900 --> 00:01:33,460
once we do that, we have to select the stage

20
00:01:33,560 --> 00:01:41,530
and this brings us to stages. Stages are like snapshots of your API, deployed snapshots.

21
00:01:41,810 --> 00:01:45,660
You work under resources and you manage all your resources there

22
00:01:45,860 --> 00:01:51,440
but if you decide, yes I get a state which I now want to use in production or at least for development, for

23
00:01:51,440 --> 00:01:59,120
testing, you have to deploy it and then basically a snapshot of your API is taken and is shipped to the

24
00:01:59,120 --> 00:01:59,750
web

25
00:02:00,050 --> 00:02:04,070
and you can view all your stages here. You can have multiple stages,

26
00:02:04,100 --> 00:02:09,850
one for development, one for production, one for version one, one for version two, whatever you want

27
00:02:09,980 --> 00:02:12,160
and here you can't edit the API and

28
00:02:12,170 --> 00:02:14,250
that is why this looks different.

29
00:02:14,480 --> 00:02:20,680
Instead the only thing you can do here is basically check out the link you get and use that,

30
00:02:20,720 --> 00:02:26,960
so you get some information about that deployment but the actual work happens under resources.

31
00:02:26,970 --> 00:02:35,250
Now what's authorizers, models and so on about? Authorizers allows you to add authentication to your API.

32
00:02:35,460 --> 00:02:42,060
So if you have certain resources, paths which should only be accessible by users who are logged in,

33
00:02:42,150 --> 00:02:49,500
are somehow authenticated to you, you can define this authentication logic or the tool, the code

34
00:02:49,500 --> 00:02:55,530
you want to use for authenticating users here because of course API Gateway needs to know on how you

35
00:02:55,530 --> 00:03:00,780
authenticate users, what authenticated means in your world and you can add such authorizers

36
00:03:00,840 --> 00:03:06,990
and if this sounds confusing, no worries, I got a whole section in this course about authentication with AWS

37
00:03:06,990 --> 00:03:14,660
Cognito and you will see, it's super easy to add authentication in the end. Models allows you to define

38
00:03:14,670 --> 00:03:18,070
the shape of the data you work with in your API.

39
00:03:18,300 --> 00:03:19,090
It's optional,

40
00:03:19,110 --> 00:03:21,140
you don't have to use that feature at all.

41
00:03:21,270 --> 00:03:25,660
Models are actually created using the JSON schema language,

42
00:03:25,740 --> 00:03:33,040
so you define how the actual JSON data your API receives should be structured

43
00:03:33,040 --> 00:03:38,310
and if you do set up models here and you will also do this later in the course, you can use these

44
00:03:38,310 --> 00:03:45,150
models to validate incoming data, see if it fits that schema, reject that if it does not and use the model

45
00:03:45,150 --> 00:03:47,010
in some other useful places,

46
00:03:47,160 --> 00:03:54,670
so that's really nice too. Documentation is also important if you plan on exposing your API to other developers.

47
00:03:54,700 --> 00:04:00,340
You can then document it and make sure that people know how to use your API, which data to send and which

48
00:04:00,340 --> 00:04:08,230
data to expect as a response. Binary support is important if you plan on sending files along with your requests.

49
00:04:08,770 --> 00:04:16,090
To send these files unchanged to the receiving endpoint or to the code which actually handles the request,

50
00:04:16,150 --> 00:04:21,820
you have to register the file types you want to forward here. And dashboards gives you some logging about

51
00:04:21,820 --> 00:04:22,730
the API,

52
00:04:22,870 --> 00:04:28,030
you can see the usage or errors which were thrown, so on a high level, you can see how your API

53
00:04:28,030 --> 00:04:30,150
performs and works.

54
00:04:30,190 --> 00:04:36,010
This is the high level overview but there is one big thing which might be very confusing and this is

55
00:04:36,010 --> 00:04:40,470
this part on the right here, I'm under resources and selected a method,

56
00:04:40,660 --> 00:04:42,370
what is this about?

57
00:04:42,430 --> 00:04:45,670
It's about how API Gateway works behind the scenes.

58
00:04:45,670 --> 00:04:48,350
So let's take a closer look in the next lectures.
