Api Gateway Simple Tutorial 
Published: 2021-12-29 13:48:23

CREATE A SIMPLE API GATEWAY ENDPOINT
====================================

*How to create a very simple API with API Gateway.*

Log into AWS and open the API Gateway module. This is where we will create an API gateway (mock for this purpose) to be used later.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.06.40-AM-500x377.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.06.40-AM.png)1. Under API click on Create API. Then your screen will look like the screen to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.07.52-AM-500x378.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.07.52-AM.png)2. Click on Build under HTTP API. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.10.08-AM-500x379.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.10.08-AM.png)3. For our example, enter “test-api” as the API Name and hit Review and Create, since this will be basic mock API. This will create a basic templated API. Hit Create again at the bottom. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.11.09-AM-500x377.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.11.09-AM.png)4. Now that your API is created, you can click on routes, on the left. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.12.00-AM-500x377.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.12.00-AM.png)5. Click “Create“ to create a test route. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.13.31-AM-500x378.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.13.31-AM.png)6. We will now create a test method. Click on the dropdown that says “ANY” and choose “GET”. Then enter in the path /test-call in the box next to it. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.15.39-AM-500x377.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.15.39-AM.png)7. Click Create. After the endpoint is created, click on the action “GET”. Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.19.24-AM-500x379.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.19.24-AM.png)8. Click on Attach Integration. We will choose “HTTP URI” as integration type.

Also enter the HTTP Method, “GET”, and the URL: <https://catfact.ninja/fact>.

I entered an optional comment.

You can as well if you want to.

Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.20.24-AM-500x377.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.20.24-AM.png)9. You now have an endpoint created. To call this endpoint, click on “Stages” on the left: Your screen should look like one to the left.

[![](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.26.55-AM-500x378.png)](http://norristechnologies.com/wp-content/uploads/Screen-Shot-2021-12-20-at-11.26.55-AM.png)10. This has $default as a default stage. This is set to auto deploy by default. This makes it easy for us. Your screen should look like one to the left.

[![Text Description automatically generated](http://norristechnologies.com/wp-content/uploads/text-description-automatically-generated-500x412.png)](http://norristechnologies.com/wp-content/uploads/text-description-automatically-generated.png)11. Now you will see the invoke URL: that is the URL we will use to test our endpoint. copy and paste it into a browser and add test-call to the end of it.

Your screen should look like one to the left.

If when you browse to this link, you should see the screen above.

If so, congratulations you have created a simple API with one endpoint.