Today I will show you step by step how to setup Postman to connect to your vROps. Documentation about vROps API can be found at: https://your_vrops_fqdn/suite-api/doc/swagger-ui.html.
Click on the Envirnoments -> Globals.
Add variable, TYPE, INITIAL VALUE and CURRENT VALUE. There are two types of TYPE:
- Default – values are visible as plain text
- Secret – values are masked
INITIAL VALUE – this value is shared with your team when you share the variable in collection, environment or globals.
CURRENT VALUE – this value is used while sending request. If you left it blank it assumes the initial value.
Variable are not limited to username or password, you can add authentication information, response data or other bits anything you need to use if various calls.
Once you have your variable setup, let’s authenticate!
The first call we need to send is /api/auth/token/acquire
. As you can use basic authentication, the best practice and faster way is to use token called bearer Token
. That token can be saved in the environment and used for successive requests.
This is a POST call to receive a bearer Token:
https://{{vrops}}/suite-api/api/auth/token/acquire
NOTE: Double curly braces are reference the environment variables for example {{vrops}}
{
"username": "{{username}}",
"authSource": "{{source}}",
"password": "{{password}}"
}
The bearer Token is a long chain of digits and letters in between <ops: token></ops:token>
Please note the expiration date for token in expiresAt
Once you obtain token, add it to variables:
How to use bearer Token?
Add token to Headers of the call. The very important thing is to properly name value as vRealizeOpsToken as otherwise it will not work.
Please like and share to spread the knowledge in the community.
If you want to chat with me please use Twitter: @AngrySysOps
Visit my FB page: https://www.facebook.com/AngrySysOps
Read my blog: https://angrysysops.com
Subscribe to my channel : https://www.youtube.com/channel/UCRTcKGl0neismSRpDMK_M4A