API Triggers taking multiple inputs

Hey,

I have recently starting to explore all the fun and useful cases around ICON.
I have some questions around using the API trigger to initiate a workflow in ICON.

I want to setup a workflow that take input provided via API about our asset inventory.
The goal is to create a global artifact containing information about client endpoints which could be used to enrich our IDR Investigations.

Lets for the scope here say that I want to import the following:
ComputerName
SerialNumber

Now I do get this to work fine is I send it in one device at a time, but I would prefer that it would be possible to run the API call with a JSON containing information about multiple devices at the same time and that the workflow then could loop through and then add each entry as a new row in our GA.

So running curl post then using the following does work:

-d '{"ComputerName":"SomeComputerName","SerialNumber":"SomeSerialNumber"}'

I have then tried running with multiple objects in different ways ex:

-d '{"ComputerName":"SomeComputerName","SerialNumber":"SomeSerialNumber"},{"ComputerName":"OtherComputerName","SerialNumber":"OtherSerialNumber"}'

and

-d '[{"ComputerName":"SomeComputerName","SerialNumber":"SomeSerialNumber"},{"ComputerName":"OtherComputerName","SerialNumber":"OtherSerialNumber"}]'

But as soon as I run with multiple entries like that it is like nothing happens, it do not even registered as a failed job in ICON. It does return a “null” response just like it have done when I push a single object and the API trigger starts the work-flow correctly.

Is it able to accept multiple object like this and I’m just doing something wrong or is it single object that is the way to go?

Thanks in advance
/Richard

Instead of passing an array, pass an object that contains the array.

e.g.
-d '{"data":[{"ComputerName":"SomeComputerName","SerialNumber":"SomeSerialNumber"},{"ComputerName":"OtherComputerName","SerialNumber":"OtherSerialNumber"}]}'

Then in your input set data as an array of objects with your object files defined (ComputerName and SerialNumber) then put a loop using that array

Ah, perfect. Thank you so much for pointing me in the right direction!
Much appreciated!