As part of automation project, we needed to use API to request a catalog.
before starting we should install postman to send requests to vRA . You can find the postman here
After installation of postman we open it and start to config to send a request
1.From the main window select POST as a request type and enter following URL
https://<vRA URL</identity/api/tokens
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/vRealize-Orchestrator_041-1024x390.jpg)
2.On the header tab set the content-type and accept headers to application/json
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/header.jpg)
3.On the body tab first select “raw” and enter payload format :
{
"username":"user@domain",
"password":"password",
"tenant":"tenanturl"
}
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/servercredentiall-1024x500.jpg)
4.Now send the request and get a token
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/vRealize-Orchestrator_048-1024x170.jpg)
This token is assigned to specific user and is valid until a few hours
5.Change the request type to GET and add bearer token to the authorization header then enter “Bearer + <Token>”
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/enterauturizationheader-1024x500.jpg)
As you see in following picture it lists all the category items, We will select one of the category items and copy it’s “id”
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/vRealize-Orchestrator_054-1024x546.jpg)
6.By copying the id to the end of requested URL we can get more info about this category
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/vRealize-Orchestrator_0064-1024x500.jpg)
Now we need to know about request template, so we add /requests/template at the end of the URL
https://<vRA URL>/catalog-service/api/consumer/entitledCatalogItems/<category id>/requests/template
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/request-template1-1024x500.jpg)
7. Finally after getting template we will copy it to the body tab and change the request type to post and change the URL to the following:
https://<vRA URL>/catalog-service/api/consumer/entitledCatalogItems/<category id>/requests/
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/copyrequestedtemplate1-1024x500.jpg)
Now we can see our request in vRA Console
![](https://www.vmehrabi.com/wp-content/uploads/2019/02/vRealize-Orchestrator_063-1024x72.jpg)