Hello,
I am getting this error when making API call. My error code:
Invalid API Response: - Results must be an array, got: object, ({"Meta":{"href":"democrm.logo.com.tr:88/LogoCrmRes) - Got a result missing the "id" property ({"href":"democrm.logo.com.tr:88/LogoCrmRest/api","mediaType":"application/json; charset=UTF-8","fullPath":"/LogoCrmRest/api/v1.0/tickets","apiVersion":"1","timeStamp":"2023-03-01T11:55:09.09"}) What happened (You are seeing this because you are an admin): Executing triggers.ticket_Id.operation.perform with bundle Invalid API Response: - Results must be an array, got: object, ({"Meta":{"href":"democrm.logo.com.tr:88/LogoCrmRes) - Got a result missing the "id" property ({"href":"democrm.logo.com.tr:88/LogoCrmRest/api","mediaType":"application/json; charset=UTF-8","fullPath":"/LogoCrmRest/api/v1.0/tickets","apiVersion":"1","timeStamp":"2023-03-01T11:55:09.09"})
Here is the code:
const options = {
url: 'http://democrm.logo.com.tr/LogoCrmRest/api/v1.0/tickets?SessionId=116ff783-01c7-431c-bd69-fbd7a4cfa47c&withCount=true&offset=0&limit=3',
method: 'GET',
headers: {
'Accept': 'application/json',
'X-USERNAME': bundle.authData.username
},
params: {
'username': bundle.authData.username
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
how do i solve this problem? Can you please help?