Skip to content

postman collection

Tzesh edited this page May 24, 2023 · 2 revisions

Postman Collection

We'll be using Postman to test the API. In the main directory of the API there is a file named 'vpatient.postman_collection.json'.

You can import this file to Postman to use the Postman collection. After importing the file you can see the Postman collection in the Postman.

But you have to change the variables in the Postman collection. You can change the variables in the Postman collection by clicking the '...' button in the top right corner of the Postman collection.

You have to change the host variable in the Postman collection. You can change the host variable by clicking the 'Edit' button in the top right corner of the Postman collection.

After selectin variables you have to change the apiURL variable if and only if you are using a domain name. You can change the apiURL variable by clicking the 'Edit' button in the top right corner of the Postman collection. If you are not using a domain name or you are going to test the API in your local environment you can skip this step.

"apiURL": "<domain name>"

Postman apiURL variable

Please make sure that you have logged in and get the token before testing the API. In your Postman collection you can see the 'Login' request. You can use this request to log in to the API. After logging in you can see the token in the response body. You can use this token to test the API.

Postman token

After getting token please set value in Authorization section of the collection.

Postman token

Then you'll be able to test the API. But if you are going to need an administrator privilege to test the API use Authorize endpoint to get the administrator privilege. Token is located in .env file which is located in the main directory of the API.

Clone this wiki locally