如果没有从我的服务器发送到 zapier 的任何所需数据,应该向 zapier 发送什么响应

What response should be send to zapier if not get any desired data to send from my server to zapier

我想将一些数据从我的服务器发送到 zapier 请求的 zapier。如果我的服务器没有该数据,应发送什么作为响应。它应该是空数组响应或一些错误消息

if(contact?.length){
  const contactClone = _.clone(contact);
   _.filter(contactClone, function(o: any) { return o.tag_updated_on; });  // if some specific contact has this field which should be rerturned
   _.orderBy(contactClone, 'tag_updated_on', 'desc'); 
  if(contactClone?.length){
    res.status(200).json([contactClone[0]]); ////First one contact from the array would be returned
    return;
  }
  
  
  res.status(200).json([contact[0]]); //What should be returned here

should be empty array response or some error message

根据您希望来电者如何回应,这两种方式都合适。如果您希望它出错,404 响应就可以了。如果调用者希望处理它,[]{} 也可能有意义。