Best answer

Why is my api request retrieving an array successfully in the developer but it is not in Zapier?

  • 6 March 2020
  • 2 replies
  • 855 views

Userlevel 2
Badge

I built out a Search api request in the Zapier Developer and was able to successfully return an array.

When I built a zap using this information it returned the same data, but gave an error saying that the data was returned as an object rather than an array. I have attached photos of both the Developer Workspace and the zap error code.


One thing to note is that in the developer I am not getting any logs in the bundle, http, or console sections of the Test Your API Request section.

Screen Shot 2020-03-06 at 3.50.07 PM.pngScreen Shot 2020-03-06 at 3.49.53 PM.pngScreen Shot 2020-03-06 at 3.49.41 PM.png


icon

Best answer by ikbelkirasan 10 March 2020, 10:48

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +12

Hi @jacob_nolley - I moved your post to the Developer Discussion as that's the best place to ask these types of questions.

@ikbelkirasan I know that you have some experience with the Developer platform, are you able to help here?


Userlevel 7
Badge +12

Hi @Danvers and @jacob_nolley

@jacob_nolley - It seems like you're returning an object instead of an array. Search actions require an array of objects as a response.

Can you switch to code mode and post a screenshot of the code in there? Basically, if the API response is an object, you would need to wrap it in an array first before you return it.

image.png