You are on page 1of 12

whenever data is submitted we will trigger our api for that we will use our api gateway

API Gateway

API Gateway:- we can create restful APIs with API Gateway,


Now API Gateway allows you to create that API, it then of course also gives
you a way of doing something with these incoming requests, to trigger an
action.
So with the API Gateway, you can then directly access other AWS services for
example or one of the most important services when we talk about that, trigger
an AWS lambda function.
So what exactly is API Gateway? With API Gateway, we can create Restful
APIs and this is how this generally works.
Typically we have an application, this can be a web app, a mobile app or some
other client reaching out to our API, like for example postman which is a tool
you can install on your machine to send requests.
Again as I just said, these clients will send requests to some API because they
need some back-end which does something for them, execute some code, store
something in a database, retrieve some data from a database, anything like that.
Now this API can be created with NodeJS, PHP and so on where you write the
whole code for providing API endpoints, URLs to which these clients can
connect on your own. API Gateway is a service by AWS which makes this
much easier, where you don't have to write any code, where you can
conveniently create that API in a nice interface.

So this is API Gateway,


we can create endpoints here which are combinations of resources, paths and
methods, HTTP methods,
so that you get URLs to which you can send requests and which you can then
handle it with API Gateway.
You could also easily implement things like authentication with API Gateway,
so that you can ensure that only the users of your app which are authenticated
are able to fetch certain data or send certain requests.
Now API Gateway allows you to create that API,
it then of course also gives you a way of doing something with these incoming
requests, to trigger an action.
So with the API Gateway, you can then directly access other AWS services for
example or one of the most important services when we talk about that, trigger
an AWS lambda function.
Now lets see about these options we can create our own APIs with some
application
here GET is a method and /first-api-test is resource
so when you create a new resource you create new path in the file or in the url you are
in

our resources are not alive, so for exposing it to web we have to select the Deploy API
until we do that all our changes will not be reflected into web once we do that we have
to select the stage, stages are like snapshot of API

no in stages we can have multiple stages one for production one for dev, etc
Here we cant edit the API , the only thing that we can do is we can check for resource
Model allows you shape of the data in your APIs

It defines how our data receive should be structured

We can use this to see if fits our schema and reject it if it doesn’t

Documentation is important we can


Documentation is also important if you plan on exposing your API to other developers.
You can then document it and make sure that people know how to use your API, which data to
send and which data to expect as a response

Binary support is important if you plan on sending files along with your requests.
To send these files unchanged to the receiving endpoint or to the code which actually handles the
request,
you have to register the file types you want to forward here. And dashboards gives you some
logging about the API, you can see the usage or errors which were thrown, so on a high level, you
can see how your API performs and works.

Dashboard gives the usage of the APIs

You might also like