[Solved] Workflow press virtual button

In the api -
curl -H ‘Content-Type: application/json’
-H ‘Accept: application/json’
-H ‘Authorization: Bearer YOUR_API_ACCESS_TOKEN’
-X POST
-d ‘{“key”:“575ed18f7ae143cd83dc4aa6-SJaEw_dV”,“payload”:{“some”:“data”}}’
https://api.losant.com/applications/APPLICATION_ID/flows/FLOW_ID/virtualButton

what is the “key” value reference?

key is the identifier of the virtual button to press. If you look at the JSON that represents your workflow, you will see in the triggers array there are probably entries that look like the following:
{"type": "virtualButton", "key": "1234d9727d90650006ad06da-Byb558I8c", ... }. That key value is what tells the API what virtual button you are pressing.

I do not see “key” tag …

Also, in the header - Authorization - YOUR-API-ACCESS-TOKEN - is it the APPLICATION API TOKEN to be used … Bearer …

I was not talking about the Example Payload section that you screenshotted above - I was talking about the actual JSON that represents the workflow (i.e., the return of the GET workflow API call - https://docs.losant.com/rest-api/flow/#get). However, what you highlighted is correct - I did not remember that triggerId in the payload for a virtual button is the virtual button’s key - so yes, that is the correct key string that you have highlighted.

For your api token, you can read more about obtaining a token here - in your case, either a User or Application API Token will work.

I get the following … although status code is 200

You look to be making a POST request against app.losant.com - that is the front-end UI. You want to be making requests against api.losant.com (like in the original example you have in the forum post at the start of this thread).

Thanks, was a type on my part. Works!!

Great! Glad you figured it out!