Developer

Working with API via Postman

Introduction

Postman is a popular API client that makes it easy for developers to create, share, test, and document APIs. In this guide, you will learn about how to use Postman for making a request to REST API, GraphQL API, and Elasticsearch Query API. Before going any further, you should first have Postman installed on your computer by downloading Postman from https://www.postman.com/downloads/ and following the installation instructions.

 

Request to REST API

Follow these steps to make a request to REST API via Postman.

1. Open Postman on your computer.

add.PNG

2. Click on the Add icon button located at the top of UI.

add_1.png

3. Put the URL on the URL field and choose the GET method from the dropdown left to it. Below is an example to get the content list of a project.

rest1_1.png

4. Click on the Send button.

rest2_1.png

5. Click on the Body and Pretty tab. The result will be displayed on the panel.

rest_3_1.png

6. You have successfully made a request to REST API.

 

Request to Elasticsearch Query API

Follow these steps to make a request to Elasticsearch Query API via Postman.

1. Open Postman on your computer.

add.PNG

2. Click on the Add icon button located at the top of UI.

add_1.png

3. Put the URL on the URL field and choose the POST method from the dropdown left to it. Select the raw radio button and choose JSON, then enter the query script on the Query panel. Below is an example to retrieve a specific query within the content list.

es1_1.png

4. Click on the Send button.

es2_1.png

5. Click on the Body and Pretty tab. The result will be displayed on the panel.

es3_1.png

6. You have successfully made a request to Elasticsearch Query API.

 

Request to GrapQL API

Follow these steps to make a request to GraphQL API via Postman.

1. Open Postman on your computer.

add.PNG

2. Click on the Add icon button located at the top of UI.

add_1.png

3. Put the URL on the URL field and choose the POST method from the dropdown left to it. Select the GraphQL radio button, then enter the query script on the Query panel. Below is an example to retrieve content details.

gq1_1.png

4. Click on the Send button.

gq2_1.png

5. Click on the Body and Pretty tab. The result will be displayed on the panel.

gq3_1.png

6. You have successfully made a request to GraphQL API.

 

What is Next?

Congratulations! You have finished the guide. Keep exploring below: