Returning Multiple Records with GENERIC API Function

How would you like the data returned? As an array? e.g

{
  "data": [
    {
      "unique_id": 299161
    },
    {
      "unique_id": 299271
    },
    {
      "unique_id": 299347
    },
    {
      "unique_id": 299383
    }
  ]
}

Then you need to supply a response template. If you are wanting a list of “unique_id” properties from the base object then instead of dragging over “unique_id” scroll down the right hand pannel and click “+” in templates.
Add the following to the template:

{
      "unique_id": <<unique_id>>
}

Dragging and dropping the “unique_id” property instead of “<<unique_id>>”.

Now save this template and drop it into the original response:

{
  "data": [<<drop template here>>]
}

That should hopefully achieve what you want :slight_smile:

1 Like