Hi all,
I have managed to perform get /vco/api/tasks succcessfully against my lab vco 7.6 and I have full admin rights. So I took the example of one of the schedule tasks, modified it and tried to create a new scheduled task based on it, but I keep getting (400) bad request. Hope someone can advise. This is an external VCO.
## assuming my $auth variable is already done
$headers = @{"Authorization"=$auth;"Content-Type"="application/json";"Accept"="application/json"}
$url = "https://myvco:8281/vco/api/tasks/"
$body = get-contect .\test.json.txt -raw
Invoke-WebRequest -Method POST -Uri $url -Headers $headers -body
I saw in the api reference that only JSON format can be sent. Attached is the json file. I validated that the json format is correct.
vRealize Automation vRealize Orchestrator Server API - VMware API Explorer - VMware {code}
Thanks
Kelvin Wong
Hi all,
Issue is resolved, tuns out that the json text files contains some hidden symbols that was not visible until I hightlight all the text. After removing the hidden symbols and also removing two of the unused parameters, it worked!
Have you looked in the app server log files /var/log/vco/app-server/scripting.log or server.log
There should be a more detailed error message there which should give info on why you get the 400 errror here.
Also, looking at the JSON sample you've provided, I'm not sure you can safely pass a vCACCAFE:CompositeBlueprint via the REST API - at least I've never tried that 🙂 - For complex or plugin types like those I normally just use a string parameter for the ID or name I want and then have the workflow resolve that to the correct instance type as part of it's processing
-HTH
Where is $query set?
My bad, typo. Not $query, but $url
Let me try removing some fo the elements
Hi all,
Issue is resolved, tuns out that the json text files contains some hidden symbols that was not visible until I hightlight all the text. After removing the hidden symbols and also removing two of the unused parameters, it worked!