Use Case

This article describes how to import a Postman collections file attached to other knowledge based articles into the Postman application for testing API Calls.   Please read these articles prior to this.

Quick Start: Bazefield API


Background

This article provides a starting point for all REST API based exercises using Postman.  Postman enables users to test API calls to various sources before implementing them in third party applications.  In several Exercises later in the Bazefield API Section, Postman files are attached and used as training tutorials at the bottom of the articles.  This article walks through the setup process of using those files.


Modifying Postman files

While a simple web browser can be used for testing API calls, this specific article also references a third party API development tool called Postman (https://www.getpostman.com/downloads/) which is free to download.  Visit the website, and the download button should be in the upper right hand corner.  


1) When working on an API exercise in freshdesk, check the bottom of the article to see if there is a ".json" Postman file attached to it which is referenced.  Save this file by clicking it.  By default, it will likely go in the "Downloads" folder on the user's personal computer.



2) Open the Postman application from the desktop




3) Import the Postman collection file downloaded in step 1, using the import button on the top left of the application.





4) On the top right side, click the Eyeball, then click Edit to change or add global variables to the postman file.  



5) Ensure that these 2 global variables are added to the environment.  This is done by clicking "Edit" on the Global Variables section.


domain:  server prefix of the user's Bazefield portal (domain.bazefield.com)

token:  user's API token in Bazefield  (see Quick Start: Bazefield API for information on where the user can find their API token within Bazefield).


Only administrators of the system can create API tokens for users in Bazefield due to licensing constraints.  If you do not have access to generate an API token in Bazefield, enter a ticket within freshdesk or through support@bazefield.com    





When Step 5 is completed, re-opening the eyeball application should look like below, with the user's information embedded in spaces 1 & 2




  1. For each collection file imported, it may also be needed to investigate and tweak other query variables associated with the requests used.  To do this, right click the collection and select "Edit", then go to "Variables" and edit variables as needed.  






These variables must be tweaked according to your tests as they are used directly as inputs to the API calls.  They are referenced in Postman through double brackets {{ }}.  When all variables have been set accordingly, clicking "Send" in blue will send the request