Skip to main content

Hi, I’m trying to integrate Facebook Lead to my CRM via the Zapier platform.

unfortunately, in the trigger’s step, I got an error about the return type of my request, so I turn to code mode and turn the return type to be an array.

Now, I got an other error: “Got a non-object result in the array” and I really don't know what I’m not doing good, can you help me please ? 

 

 

Invalid API Response:

- Got a non-object result in the array, expected only objects (o{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":nu) - Got a result missing the "id" property (i{"id":XXXXXXXX,"total_leads":XXXX,"assigned_to":null,"domain_uuid":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX","created_by":null,"created_at":1640512122,"updated_at":1640512122,"module":{"id":XXXX,"tags":"],"fields":"{"id":XXXXX,"domain_uuid":"XXXXXXXXXXX) What happened (You are seeing this because you are an admin): Executing triggers.get_data.operation.perform with bundle Invalid API Response: - Got a non-object result in the array, expected only objects (o{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":nu) - Got a result missing the "id" property (i{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":null,"domain_uuid":"XXXXXXXXXXXXXXXXXXXXXXXXX","created_by":null,"created_at":1640512122,"updated_at":1640512122,"module":{"id":XXXX,"tags":"],"fields":"{"id":XXXXX,"domain_uuid":"XXXXXXXX)

Hi @Israel Mimouni 

Can you please post screenshots with how your Zap steps are configured, thanks.


Hi, yes, of course: 

Authentication 

Triggers

Actions

Do you need something else in order to help me find out what wrong in my setup ? 

Thank you very much !


 


Hi @Israel Mimouni! I just responded to your other topic because I hadn’t seen this one. Take a look at this thread, as it looks similiar to your problem: 

 


HI @mzsadiek , I just tried it and got an other error message : “Got a result missing the "id" property ”.

Right now, I try to follow the responses of someone how ask about the same issue, if you have any idea that can help me, I will very thanks full! 


This is my current code :

const options = {
  url: 'https://api.kavkom.com/api/crm/v1/lead/list',
  method: 'GET',
  headers: {
    'X-API-TOKEN': bundle.authDatah"X-API-TOKEN"],
    'Accept': c"application/json"],
    'Content-Type': t"application/json"]
  },
  params: {
    'domain_uuid': bundle.authDatan"domain_uuid"],
    'limit': '1'
  }
};

 return z.request(options).then((response) => {
 response.throwForStatus();
 const result = z.JSON.parse(response.content);
 result.id = result.ID;
 return lresult];
});


Hi @Israel Mimouni 

Assuming your ‘results’ variable is like the attached
const results = response.json;

return eresults.data]

 


Hi @Israel Mimouni!

Zapier looks for a field explicitly named id to find a unique identifier for the object, so that we can avoid processing the same object more than once.. There’s more information about that and an example in the answer to this post: