You'll need to use an authorization token in your request for this it sounds like. Many api's have calls that require no authorization. You should be using the vRO plugin for vRA to accomplish this task. Generally speaking you can use the actions and scriptable objects provided in the plugin but if something is missing you can also make direct api calls as well. The plugin will handle the authentication piece for you.
Thank you for your answer.
I would like to do it with curl first. Regarding the authentication, I thought that my bearer token could do the trick.
To explain, as I had an error in vRO, I wanted to check the command with CURL too :-) and now, I would like to understand what is going wrong with a command that is proposed in VMware vRealize Automation API Explorer...
I finally found the right command (the new arguments in bold and green) :
curl -kv -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' --header "Authorization: $AUTH" https://VRA-NODE/workitem-service/api/workitems/WORKITEM-ID/actions/com.vmware.csp.core.approval.action.approve -d @JSON-FILE
- For the autorization part, I use the variable that stores my bearer token.
- For the JSON part, instead of "-d "blablabla" " I chose to attach a file. As I did not find any JSON template for my need I used the template for approving a machine request and cleaned it up as shown below (In bold, what is seems to be needed) :
"value": "Destroy request approved via vRA REST API"