chelnak
2/24/2016 - 3:30 PM

Example of interacting with the control center action "Cancel all tokens of a workflow" in vRO

Example of interacting with the control center action "Cancel all tokens of a workflow" in vRO

<#

Cancel all tokens of a workflow or a list of specific workflow tokens

Example body

  {

    "tokenIds" : [],
    "workflowId" : "f75459b7-128d-4ff0-ad99-b9d454307eeb"
  
  }

#>

$WorkflowId = "f75459b7-128d-4ff0-ad99-b9d454307eeb"

$Uri = "https://[yourvroserver]:8283/vco-controlcenter/api/server/cancel-workflows"

$Body = @"
    {
        "workflowId" : "$($WorkflowId)"
    }
"@

Invoke-RestMethod -Method POST -Uri $URI -Headers @{"Content-Type" = "application/json";} -Body $Body -Credential (Get-Credential $null)