Skip to content

API Using Postman

Brandon Spears edited this page Jul 2, 2019 · 1 revision

Using Postman

Step 1 - Download Postman

Postman is a API Development Environment that will allow you to use A Graphical User Interface (GUI) to create API calls to Scholar. While everything you will need to do this is available by using curl, it is more intuitive to use this. To download Postman, visit https://www.getpostman.com/downloads/ and install it for your system.

Download Postman

Step 2 - Account Setup

Postman requires you to create an account to use, and only allows for 1,000 calls a month (for the free version). After the account is created and validated, log into the application on your machine.

Step 3 - Set Up

After logging in, we would recommend using collections to organize your requests. Not only does this make it faster to find the request you are looking for, but it allows for easier collaboration later.

Organize Collection

Step 4 - Create a Request

Now to create some requests. To do this you can either click the new button in the top left of the application, or by clicking the elipsis (...) and selecting Add Request. Then you will see a modal that will prompt you for some information about the request that you are trying to create. You can name it whatever you would like, but we generally use what you are trying to do, such as Return a User. The description is optional, and can be useful for notes for anyone trying to use the request. Then you can choose to put it into a collection.

Create Request

Step 5 - Customizing the Request

The next step is to customize the request. Our API uses a header value to authenticate the request. To add your key, simply go to the Headers tab, and add the key. It will be in the format API-KEY for the key, and your actual key for the value.

Keys Value

Then you can add the data that you want to submit. Once you know the call that you want to make (see the main API wiki page for all calls), you can start filling in the data that you want to submit. The first step is to give the correct information about the call, such as the method (GET, PATCH, etc.), and the url (https://scholar.uc.edu/api/users). These vary by the request and perform different actions depending on the data. After you have entered the URL and the method, it is time to start adding the JSON. JSON is short for JavaScript object notation, and it is how our application takes in data for specific fields. Since JSON uses a key value system for information, it is important that you check the appropriate wiki page for more information on the allowed fields. To start adding JSON, simply click on the Body tab. Our application supports both raw JSON (you have to specify JSON when you click raw), and JSON in form-data. We recommend using form-data for file uploads. Please note that Postman will give you an error if you are trying to upload files not from a specified directory (For us it was home/Postman/files). Another thing to note is that when specifing a file using form-data, you need to specify it as a file, so for a key it will have a dropdown, then select the file. After you have finished adding all of the fields that you want, simply click send to send the request. The response will then show up in the right side of the application.

Final Result