Hasura Data API + Postman collection

Sai Chaitanya
3 min readJul 12, 2017

--

In this phase,everyone has to learn to use HasuraData API’s for making CRUD (Create,Select, Update and Delete) queries to our Hasura local development project.

what is postman collection?

Postman Collection SDK is a NodeJS module that allows a developer to work withPostman Collections. Using this module a developer can create collections, manipulate them and then export them in a format that the Postman Apps andPostman CLI Runtimes (such as Newman) can consume.

For making these API requests, we will be using Postman app. Make sure you have installed the same.

There are 2 ways by which we can make data requests using Hasura Data APIs to our PostgreSQL database :

1)Making requests on same machine using Hasura local development. In this method, you will get a external endpoint like : http://data.c100.hasura.me/

2)Exposing Hasura local development to the Internet and making requests from same / different machine. In this method, you will get external endpoint like : http://data.<project-name>.hasura-app.io/

For the purpose of the blogpost we will be using method 1, but the same steps can be performed for method 2 as well.

go through the following steps:

  1. login to the console
  2. click on the data icon and select manage option then copy the external end point link
  3. After that one needs to install postman app into the system
enter the details at the rounded marks

5)go to the header and in the key section write “Authorization” and in the value one need write “Bearer <auth-token>” here auth-token refers to the token given to you at the tome of login to the console and it is present in the homepage of the console.

6)click on the body section and select raw option and select the json(application) option in the box.

7) then we need to perform the CSUD (create,select,update,delete) commands on the table using postman and i am going explain the process by using images.

8)for selecting the content of the data on need go follow this image:

fig.shows selecting of the data from table using postman

9)For inserting the data into the table one needs to go through this image:

fig.shows how to insert the data into the table using postman

10)Updating the data into the table is shown in the year:

fig.shows updating the data into the table using postman

11)Deleting the data from the table is shown in the image:

fig.shows deleting the data from the table using postman

--

--