Hi,
I wrote a powershell script to execute a workflow that I don't own via API call (Invoke-RestMethod).
$run_response = Invoke-RestMethod -Uri $run_url -Method Post -Headers $headers -body $json_payload -ContentType 'application/json'
However, I get the following error:
Invoke-RestMethod : {
"message": "Access denied."
}
+ ... _response = Invoke-RestMethod -Uri $run_url -Method Post -Headers $he ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommandI tried running my script on workflows that I own and it works fine. I also tried using the owner's credentials and it works fine too. However, when I use my credentials to run a workflow that I didn't create, I get an access denied error. I tried running powershell as administrator and my role is set to 'Curator'. I use Tls12 security protocol in my script.
Anyone encountered this issue?
Thanks