Hi @waterbeemds , yes the /fmerest/v3/automations/workflows/{id}/trigger endpoint supports this:
- In your automation, open the Manual Trigger and click Output Keys > Import from JSON
- Paste a valid, sample JSON body into the textbox and click Parse
- FME Server will create a manual key for each top-level JSON key name
- Now you can use the manual key(s) downstream in your automation as needed (for example, emails, logging, other workspaces, etc...)
- In the HTTPCaller that calls the FME Server REST API:
- enter the JSON in the Body > Upload Body. This is where you can use the text editor and supply dynamic values for the keys
- choose JSON (application/json) as the Content Type
So, for example, if I were to use a sample JSON body of:
{
"country": "Canada",
"city": "Vancouver"
}
And parse the keys in the Manual Trigger, two keys will be created, manual.country and manual.city, that can be used downstream in the automation.
If I was reading a file of countries and cities and wanted to call the REST API for each feature, I could enter this as my Upload Body JSON in the HTTPCaller:
{
"country": "@Value(country)",
"city": "@Value(city)"
}
Please note that this only works for top-level JSON keys. If your JSON is more complicated and has nested objects and arrays, you'll need to flatten them into a more simple structure using the various JSON transformers available in FME.
Hi Mattmatsafe,
I had someone in the company look at it, and together we got the same conclusion as you.
First, set up the Manual key's and link them downstream. You can then use the names of the Manual key's (in your example country and city) in your HTTPCaller body in a correct JSON structure. Make sure you have the Headers "Accept" and "Content-Type" set to application/json.
When running the workspace, you values set in the HTTPCaller body will be used in the Manual keys and then used in downstream actions, like workspaces.
Thank you for your reply.