I'm trying to trigger a workflow from the API. I have used the built in generator and I have the correct API call for a simple workflow:
https://10.10.10.76:8281/vco/api/workflows/65933170-a081-4cb2-89cb-5374b49a0a21/executions
However I am getting this:
Any ideas?
Thanks!
Have you set the authentication header?
This old walk-through I did still applies with very little/no change required for current versions: http://bit.ly/restvco ( https://www.vcoteam.info/articles/learn-vco/268-how-to-use-the-rest-api-to-start-a-workflow.html )
I have seen that, however its using that REST API plugin.
What I would like to do is fire off a workflow out of the Service Now self service portal...which will let you assign an API Call URL to a button for a user to click on.
Im just not sure how to build the back end piece. Also the workflow requires 4 user inputs, so I wasnt sure if the API web Call would pop open the window to request input parameters for the workflow
Ah, ok - I don't know the ServiceNow side so not sure what you have available over there. My article is note using an API plug-in, it is simply using a generic tool to make a call to the vRealize Orchestratro REST API. The only API available for vRO is REST based so anything capable of making a call to a REST API should be able to launch a vRO workflow assuming you have the correct headers set, content format, and endpoint url (Your original post looks like you have this last bit set fine).
Well Swagger (from the VRO local portal) generates this for me: I just have no idea what goes in here or how to pass authentication (which is LDAP) I read some docs, but I dont see any examples. Just hitting the URL SHOULD fire off the workflow, but clearly not happening LOL
curl -X POST --header 'Content-Type: application/xml' --header 'Accept: text/html' -d '{
"parameters": [
{
"description": "string",
"encryptValue": true,
"name": "string",
"scope": "local",
"type": "string",
"updated": true,
"value": {
"objectType": "string"
}
}
]
}' 'https://10.10.10.76:8281/vco/api/workflows/65933170-a081-4cb2-89cb-5374b49a0a21/executions'
Your examples in XML and JSON are also hard coding the parameters as well? I need to ask the user for the 4 input parameters. How would that be accomplished?
That is dependent on the system calling and how it allows you to form XML or JSON content.
This looks wrong... if using a JSON content as shown in your post then the Content-Type header should be application/json
Also, there is no authentication in that example either... no interactive or set header being shown...
Well thats correct cuz I select the application/XML template, not the JSON one.
"Also, there is no authentication in that example either... no interactive or set header being shown"
Yes, also correct....because I dont know how to set those items. Thats kinda what I was looking for. This is my first time attempting the REST API for VRO
In the curl command above, you need to add the parameter
--user myuser:mypassword
(replacing myuser and mypassword with the actual credentials you use to authenticate in vRO)
Also, the header 'Accept:text/html' is wrong; for the result of this API you'd want to receive response in XML or JSON format, so the proper header would be 'Accept: application/xml' or 'Accept: application/json'
Well that Curl Command was generated by Swagger in VRO. I dont know how to USE that command....or what to use to edit it and fire it off for testing.
Im brand new to the REST API model and I dont know how to use any of this. It doesnt seem that difficult, but I dont really know how it all goes together.
If you prefer not to specify the password in plain text, you could base64 encode it then set your authentication header as follows:
curl --header 'Authorization: Basic ENCODEDPW_HERE'
While I'm sure there are command line ways of getting the base64 encoded text for a user/password combination, I simply use Postman to do it for me by setting authorization to Basic, providing a username and password, then viewing the Authorization header that gets set.
I tried the Rest Client of Firefox with basic auth and I get
So what would the Curl text look like for http authentication? (which is grayed out for me)
Also Im curious about this because in the vro Control center, its using Vshpere which is LDAP
Please check your private message here in the communities.
I am also facing same issue.
I'm a bit confused. As there were several messages in this thread with slightly different issues, could you clarify what exactly is not working in your case and how are you calling the vRO API?
curl -X POST --header 'Authorization: Basic cccbbbcjjcwnqnwjloveovjreovnejrvnelvljkeqv' --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{