How to use API to request a catalog in vRealize Automation 7.4

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

2.On the header tab set the content-type and accept headers to application/json

3.On the body tab first select “raw” and enter payload format :

{
	"username":"user@domain",
	"password":"password",
	"tenant":"tenanturl"
}

4.Now send the request and get a token

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>”

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”

6.By copying the id to the end of requested URL we can get more info about this category

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

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/

Now we can see our request in vRA Console


Leave a Reply

Your email address will not be published. Required fields are marked *

49 + = 50