Skip to main content

The NetHunt API documentation provides the following endpoint which allows for the querying of records within a NetHunt folder: /searches/find-record/{folderId}?query={query}&limit={limit}

 

In my use case I have a need to return multiple items from this folder which I will use down the line to populate a drop down box. Use of this endpoint in Postman works just fine and returns all of the data that I expect (which is information regarding three entries in the folder i am searching). When trying to use a Zapier Webhooks step to perform the GET however, Zapier only provides the data for the first of the items returned. This is true whether I use the standard GET function or a custom request made to mirror my request in Postman. Why is this happening and what options do I have (if any) to return multiple items from an HTTP request via Zapier? 

 

EDIT: I should add, I AM setting a query limit, I’ve tried 25, and 5. Both return the same result, just one record in data output of the test. 

Hi @az_automation_guy 

For us to have more context, post screenshots with how your Zap step is configured in EDIT mode.

 

NOTE: You may need to try using a Code step to make the API request: https://zapier.com/apps/code/help


 

Here is what the Test results look like: 

 

And here are the results from the exact same call in Postman: 

 


@az_automation_guy 

Try using the Query String Params section to set your query string parameters. (key/value pairs)

That would be everything after the ?

The URL should include everything before the ?

 


I’ve done that but just tried again. The result is the same. It only returns one record instead of the expected 3


@az_automation_guy 

You’ll have to try this suggestion…

NOTE: You may need to try using a Code step to make the API request: https://zapier.com/apps/code/help


Ok, I’m now making the call via a Code step and check out what is getting returned: 

 

 

 

Is this a bug that Zapier isn’t parsing out the extraneous data included in the screenshots above or is this a bug/case of the NetHunt API not providing this data in a standard format? 


@az_automation_guy 

I’ve seen other app APIs where it will only return 1 record for a query when multiple records should be returned.

I believe this is due to how the app API is returning the JSON response structure VS how Zapier expects a JSON response to be structured with arrays, so Zapier only parses the first record.

 

When making an API call via a Code step, you have full control over how to handle the API response, so you should be able to get it output however you desire.


I totally get that, but did you see the output I posted in the screenshot above? What NetHunt is sending back seems very unusual to me. I’m going to try to parse that into a useable format but it seems really off to me. 


@az_automation_guy

The logged returned response shows an array of object items.

Probably need to adjust the code to iterate thru each to output as desired.

 


Look at the data, that doesn’t look like valid JSON to me: 

  • Field named aren’t double quoted
  • Some values are singled quoted, others aren’t quoted at all

 

In order to use any of this I am going to need to do a TON of parsing. Something doesn’t seem right here. 

 

 


@az_automation_guy 

Probably best to contact NetHunt Support for help with their API.


I already have a request into them but I suspect that this is a Zapier issue. None of these problems appear to exist if I make the API call to the same endpoint via Postman. 

 

 


@az_automation_guy 

In your Code step, you likely need to handle the returned API response to properly output the desired data and potentially parse into variables.

We’d need to see screenshots with how your Zap Code step is configured to have more context.

Try asking ChatGPT for help with the Code.