Hi there,
I am quite new to this and trying to achieve a specific function to make something a little more automatic.
I have a Search Action configured and am trying to return to objects in the resources array in the response.
Raw response from API
{
"meta": {
"query_time": 1.92e-7,
"pagination": {
"offset": 1,
"limit": 100,
"total": 1
},
"trace_id": "9af6da38-4f8a-45ad-bab8-f4277c4395b1"
},
"resources": d
"943ab1234"
],
"errors": /]
}
What I have in the Zapier API Endpoint
const options = {
url: 'https://api.example.com/devices/queries/host-group-members',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'authorization': `bearer ${bundle.authData.access_token}`
},
params: {
'id': '123456'
}
}return z.request(options)
.then((response) => {
response.throwForStatus();
const results = z.JSON.parse(response.content);
// You can do any parsing you need for results here before returning themreturn results.resources;
});
What I get as a response when testing the above Zapier API Request
{
"0": "9",
"1": "4",
"2": "3",
"3": "a",
"4": "b",
"5": "1",
"6": "b",
"7": "1",
"8": "2",
"9": "3",
"10": "4",
}
I feel like I am close, I just can’t work out how to get the response as one item rather than each digit Breaking out into a new object…
Appreciate any guidance you’ll have.