7.3

Table Of Contents
3 Get details for a specific work item ID.
Use the workItemId to get the details for this work item. In this example, the workItemId is
5e3e9519-78ea-4409-a52c-e4aa3bc56511.
curl --insecure -H "Content-Type: application/json"
-H "Authorization: Bearer $token"
https://$vRA/workitem-service/api/workitems/5e3e9519-78ea-4409-a52c-e4aa3bc56511
For details regarding input and output for this request, see Syntax for Getting Work Item Details.
4 Construct a JSON file that contains the work item ID information that you need to approve a machine
request.
a Copy the appropriate JSON input file template to a new file in an XML editor that maintains
formatting.
b Substitute the input variables in the template with the values you obtained for your specific work
item ID, for example 5e3e9519-78ea-4409-a52c-e4aa3bc56511.
c
Save the file with a new name, for example, approve.json.
For details regarding input and output for this request, see Syntax for Constructing a JSON File to
Approve a Machine Request.
5 Approve the submitted machine request by specifying the work item ID and including the JSON file as
part of the command line.
curl --insecure -H "Content-Type:application/json"
-H "Authorization: Bearer $token"
https://$vRA/workitem-service/api/workitems/5e3e9519-78ea-4409-
a52c-e4aa3bc56511/actions/com.mycompany.csp.core.approval.action.approve
--d @approve.json
For details regarding input and output for this request, see Syntax for Approving a Submitted Machine
Request.
If the command is successful, the HTTP status is 201 Created. If the command is not successful, the
HTTP status is 204 No Content.
Work Item Service Examples for Approving a Machine
Request
Syntax for each service example lists input parameters, output parameters, and curl commands.
n
Syntax for Listing Work Items
GET /api/workitems lists the unique IDs of all available work items.
n
Syntax for Getting Work Item Details
GET /api/workitems/{id} retrieves the details of a pending work item. You need these details to
submit a completion request.
Programming Guide
VMware, Inc. 64