Steps :
1. Create Environment :
First create new environment or you can use existing environment.
Create a variable named token in the environment created in step 1. Here I have created Test environment and created token variable.
3. Create Collection :
Then create a collection. I have created a collection with Test name here. In the Authorization tab of collection set it to Bearer token and in token tab enter the variable created in step 2.
4. Add token request :
Now add the token request in the collection created. Enter the token url, credentials and all the details required.
5. Code to set token variable :
Once all details are entered, add the following code to the Tests segments of the request.
6. Use generated token in apis :
Step generates the token and sets the variable (token). Now we can use that variables in all apis for authentication. For all apis that we need to run using this token, select environment as test.
Thank you for reading..!!!