Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction📑
2.
Overview of API Deployment🔎
2.1.
Connecting to an API Gateway🤝
2.2.
Viewing API Deployments in Postman👀
3.
Deploying to an Amazon API Gateway💼
3.1.
Accessing Amazon API Gateway🧑‍💻
3.2.
Utilizing an AWS IAM Role to Authenticate🎯
3.3.
AWS Access Key Authentication🗝️
3.4.
A Schema Import🏷️
3.5.
Observing the Deployments of Amazon API Gateway🧐
4.
Deploying to an Apigee API Gateway💻
4.1.
Establishing a Service Account and Private Key🔥
4.2.
Accessing Apigee X🚀
4.3.
Analyzing Apigee X Deployments👩‍💻
5.
Frequently Asked Questions
5.1.
What is API testing?
5.2.
What are the various types of API?
5.3.
How are APIs created?
5.4.
What does API header mean?
5.5.
Is coding necessary for API testing?
6.
Conclusion 
Last Updated: Mar 27, 2024
Easy

Deployment of an API in Postman

Author Ishita mishra
0 upvote
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction📑

What’s the benefit of an API? Ask most developers this question, and they’ll tell you that APIs are beneficial because they link different applications and services together. But APIs' significance goes far more profound. You can use APIs as the cornerstone of your development strategy with the help of API deployment, which goes beyond using them as a tool to assist in the creation of apps.

Deployment of an API in Postman

This article covers API deployment, why it's crucial, and the two gateways used for API deployment.

Overview of API Deployment🔎

Connect to an API gateway to keep track of your API installations with Postman. Amazon API Gateway and Apigee X are only two of the well-known API gateways that Postman interacts with. You can examine your API deployment status and history from within Postman.

Connecting to an API Gateway🤝

Select APIs in the sidebar, then choose the API and version you wish to connect to in Postman. Select AWS API Gateway or Apigee X under the Deployments tab.

To configure the API gateway integration, enter the necessary data. See Deploying to an Amazon API Gateway or Deploying to an Apigee API gateway for further information on the specific steps.

API Deployment

Viewing API Deployments in Postman👀

After connecting to an API gateway, you may check the deployment history of your API schemas in Postman. Select the Deployments tab after choosing an API and version from the sidebar under APIs.

Details about recent deployments and your API gateway are shown in the Deployments tab:

Amazon API Gateway: View the most recent Postman exports, the active deployment for each stage, and deployment details using the Amazon API Gateway. Additionally, you can export or deploy your gateway's HTTP API schema using Postman. More information is available under Viewing Amazon API gateway deployments.

Apigee X: View information about your Apigee API proxy and proxy endpoints with Apigee X. Additionally, you can access information about your Apigee environments. Find out more information on viewing Apigee X deployments.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Deploying to an Amazon API Gateway💼

Deploying to an Amazon API Gateway

Developers can publish and manage APIs that access AWS and other online services and data sources using Amazon API Gateway. Once connected to API Gateway, Postman allows you to examine the status and details of your API deployments. You may also check Amazon CloudWatch metrics for each stage to gain operational insight into your API.

Accessing Amazon API Gateway🧑‍💻

Select APIs in the sidebar, then choose the API and version you wish to connect to in Postman to connect to Amazon API Gateway. AWS API Gateway should be chosen after selecting the Deployments tab.

Accessing Amazon API Gateway

You have the option of utilizing an AWS access key or creating an IAM role when configuring the connection to API Gateway. The steps for your selected method are listed below. You have the option to import a schema from the API Gateway after configuring the connection.

Utilizing an AWS IAM Role to Authenticate🎯

Select IAM under AWS Authentication Mechanism to configure an AWS IAM role connection to Amazon API Gateway.

Connect to AWS API Gateway

Give this integration a nickname, then choose the AWS API type (HTTP or REST).

Next, build a Postman IAM role in AWS:

  1. Select Create role after launching the AWS IAM console.
     
  2. Choose a different AWS account under "Select the type of trustworthy entity".
     
  3. AWS Account ID for Postman is 258201882842.
     
  4. Enter the External ID from Postman and tick the box next to Options: Require external ID. The external ID is listed under Step 1: Create an IAM Role.
     
  5. Select Permissions under Next.
     
  6. Choose to Create a policy or a preexisting IAM policy. Use the JSON code given below when developing a policy:

 

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt909923626743",
            "Effect": "Allow",
            "Action": [
                "apigateway:GET",
                "apigateway:PUT",
                "apigateway:POST",
                "cloudwatch:GetMetricData"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}


This policy will make it possible to export and deploy HTTP API schemas. (Exporting and deploying for REST API schemas are not supported.) Based on your requirements, you can modify the IAM policy's Action section:

🧣"apigateway:GET" - (Required) Allows Postman to display API Gateway deployments for HTTP and REST APIs.

🧣"apigateway:PUT" - Allows HTTP API schemas to be exported to the API Gateway.

🧣"apigateway:POST" - Allows the API Gateway to deploy HTTP API schemas to a stage.

🧣"apigateway:*" - Assigns the IAM role with all GET, PUT, POST, PATCH, and DELETE permissions.

🧣"cloudwatch:GetMetricData" - This allows Postman to display CloudWatch metrics.

7. Choose Next: Tags.

8. Click Review under Next.

Select Create role after adding the Role name and Role description.

Copy the AWS Role ARN and paste it into Step 2 of Postman. Specify the region and the role. Next, choose the API Gateway and input the AWS Region where it is situated. Select Connect when you're prepared.

AWS Access Key Authentication🗝️

Select Access Key under AWS Authentication Mechanism to configure an AWS access key connection to Amazon API Gateway.

AWS Access Key Authentication

Enter the following connection details after that:

  • To complete this integration, enter a nickname.
     
  • Choose an AWS API Type (HTTP or REST).
     
  • For your AWS account, enter the Access Key ID and Secret Access Key for your AWS account. (Find out how to access your AWS credentials.)
     
  • Select the API Gateway after choosing the AWS Region where it is located.


Select Connect when you're prepared.

A Schema Import🏷️

You have the option to import an HTTP or REST schema from the API Gateway after configuring the connection:

🚀Choose the AWS stage from which to import a schema, then click Import. If your API schema already exists, importing a schema will replace it; otherwise, it will add a new schema.

Connect to AWS API Gateway

🚀Select Maybe later if you don't want to import a schema. Once connected to Amazon API Gateway, you can import a schema.

Observing the Deployments of Amazon API Gateway🧐

After connecting to Amazon API Gateway, you may check the export and deployment history for your API schemas in Postman. Select the Deployments tab after choosing an API and version from the sidebar under APIs.

  • You can see each stage's live deployment and the most recent update date. A week's worth of CloudWatch metrics, including average latency and the quantity of 4xx and 5xx failures, is available.

📌To display more information, including the invoke URL and stage description, select the arrow next to a stage (from AWS).

           📌 To examine metrics on the CloudWatch dashboard, select a stage name.

  • You can see the export's source and the time it was exported for each export from Postman.
  • You may view the deployment ID, description, and creation date.
Observing the Deployments of Amazon API Gateway

You can do the following operations from the Deployments tab:

  • Select the AWS Gateway ID to view your API Gateway in AWS.
     
  • Select Deploy API to export or deploy an HTTP schema to the API Gateway. Find out more about implementing your API.
     
  • Select Import Schema to import a schema from the API Gateway. Get additional information about importing a schema.
     
  • Select View Dashboard to see API Gateway stats in AWS.
     
  • Select the refresh icon to get the most recent deployment progress information.
     
  • Select the "more actions" option to update or remove the connection to Amazon API Gateway.

Deploying to an Apigee API Gateway💻

Deploying to an Apigee API gateway

Developers can manage access to their APIs by abstracting services behind a secure proxy layer by deploying to an Apigee API gateway, such as Apigee X. Once linked to Apigee X, Postman allows you to see the status and details of your API deployments.

Establishing a Service Account and Private Key🔥

A service account email and a private key must be entered when establishing the connection to Apigee. The necessary elements can be created in your Google Cloud project. To add a custom role, create a service account, and produce a private key, adhere to the below steps.

To create a distinctive role:

  • Go to your project settings in the Google Cloud Platform console after logging in.
     
  • In the left navigation pane, choose Roles and click + Create Role.
     
  • After providing the necessary information for the position, choose + Add Permissions.
     
  • For each of the following permission properties (type a property name to find it in the list), check the box next to it:

     apigee.deployments.list

     apigee.environments.list

     apigee.environments.get

     apigee.organizations.list

     apigee.organizations.get

     apigee.proxies.list

     apigee.proxies.get

     apigee.proxyrevisions.get

  • Select Add, then double-check that the role now has the proper permissions assigned.
     
  • To complete establishing the custom role, select Create.
8 Assigned Permissions

To set up a service account:

  • From the navigation menu on the left, choose Service Accounts.
     
  • To create a service account, select +.
     
  • Select Create and Continue after filling out the necessary information for the service account.
     
  • Pick the custom role you made from the Role drop-down list (enter the custom role name to locate it in the list).
     
  • To finish creating the service account, click Done.
set up a service account

To create a private key:

  • Open the new service account by selecting it, then choose the Keys tab.
     
  • Select Create new key after selecting Add key.
     
  • Select Create after choosing the JSON key type.
create a private key

Your browser will immediately download a JSON file with client_email and private_key values. When connecting Postman to Apigee X, use these values.

Accessing Apigee X🚀

Select APIs in the sidebar, then choose the API and version you wish to connect to in Postman to connect to Apigee X. Then choose Apigee X under the Deployments tab.

Accessing Apigee X

Initially, use Apigee X for authentication:

  • Enter the Private Key and Email for the Service Account. The values are contained in the JSON file that you downloaded.
     
  • Choose Connect.
Apigee X for authentication

Next, configure Apigee X's connection:

  • Choose the Organization that owns the proxy that Postman should connect to.
     
  • To complete this integration, enter a nickname.
     
  • Choose the API Proxy you want to use to connect Postman to your API version.
     
  • Choose one or more environments in Apigee X where you will deploy your API.
     
  • Choose Finish Installation.
Connect to Apigee X

Analyzing Apigee X Deployments👩‍💻

You can use Postman to see your API schemas' deployment status and history after connecting to Apigee X. Select the Deployments tab after choosing an API and version from the sidebar under APIs.

  • You can check your API proxy's most recent revision, source, creation date, and most recent change date.
     
  • It is possible to see the name and base pathways for every proxy endpoint.
     
  • You may check the description, most recent update date, status, deployed revision, and deployment date for each Apigee environment.
Analyzing Apigee X Deployments

You can do the following operations from the Deployments tab:

  • Choose a deployed revision or the most recent revision in Apigee X to examine your API proxy.
     
  • In Apigee X, choose API Metrics to view performance statistics for your API proxy.
     
  • Select the refresh icon to view the most recent deployment status.
     
  • Select the "more actions" icon to edit or remove the Apigee X connection.

Frequently Asked Questions

What is API testing?

Application Programming Interfaces (APIs) are tested as a type of software through API testing (APIs). Programming interfaces must be secure, fast, dependable, and functional. This is the aim of API testing.

What are the various types of API?

Public, partner, private, and composite are the four primary forms of API that are frequently used in web-based applications.

How are APIs created?

They are created by combining the already-existing API functions that let the execution of numerous operations in a single call.

What does API header mean?

As they show the meta-data related to the API request and response, HTTP Headers play a significant role in the API request and response.

Is coding necessary for API testing?

API testing is a sort of testing that lends itself well to automation and often calls for technical knowledge.

Conclusion 

In this blog, we have extensively discussed the methods to deploy an API in Postman and also observed deployment in AWS and Apigee. If you liked this blog, you should also check out these fabulous blogs to upskill yourself in  APIWeb Testing, and API Testing.

Be Curious Image

You may also visit our website Coding Ninjas Studio to read more interesting blogs and upskill yourself in Android DevelopmentCoding Ninjas Studio ProblemsCoding Ninjas Studio Interview BundleCoding Ninjas Studio Interview ExperiencesCoding Ninjas CoursesCoding Ninjas Studio Contests, and Coding Ninjas Studio Test Series.

You may consider our paid courses to give your career an edge over others!

Happy Reading, Ninjas!

Previous article
Define, Develop and Test Your API in Postman
Next article
Observing and Viewing an API in Postman
Live masterclass