The Result Was Not An Array,

Is there anyway I can fix this through appgyver and get the API to work?
The messages I’m getting when trying to integrate my API and use it as a get data API is

Error: Error:
The result was not an array. Maybe the data you’re looking for is inside one of the response object keys?

{
“data”: [
{
“email”: “Savagesmurf1212@gmail.com”,
“key”: “GLYS-DVVR-9905-545U”,
“unlocked”: false,
“status”: “active”,
“cancel_at”: null,
“canceled_at”: null,
“trial_end”: null,
“created”: 1615426679887,
“account”: “qaLXRpDwE8xfI29F0Lo-T”,
“customer”: null,
“subscription”: null,
“payment_method”: null,
“plan”: {
“account”: “qaLXRpDwE8xfI29F0Lo-T”,
“active”: true,
“product”: “prod_J5W5cHd7rAwedD”,
“price”: “price_1ITL3lFHYphcVt7x2gdsrrP7”,
“name”: “Beta Tester”,
“allow_reselling”: false,
“amount”: 0,
“created”: 1615355897144,
“currency”: “usd”,
“roles”: [
“818982666019143710”
],
“recurring”: null,
“type”: “free”,
“id”: “ZaXOCVg3hR3COYQC_Izqi”
},
“release”: null,
“metadata”: {},
“user”: null,
“id”: “U338ldRC2UE4OVUcPdvfb”
}
],
“total”: 1,
“page”: 1,
“has_more”: false
}
status: -1

Resource settings for Get collection (GET)

Is there a way to make it create a scheme and not give me this message? Thanks

Hi,

Yes, that API seems to return an object data that holds the list you want. You can avoid this error by setting the Response key path to data .

1 Like

Just wanted to say thank you. This solution just solve my issue of the error:

Error: Error:
The result was not an array. Maybe the data you’re looking for is inside one of the response object keys?

In my case (EspoCRM), I need to add “list”

Unfortunately when I try the same thing with

GET RECORD (GET)

I get an error:

Error: The server responded with a list for a single data record. The response must be an object.status: -1

My JSON result look like this,

I tried to use the response key as, “total” but it just came back as 7 so that can’t be right, tried, “total.list” but that don’t work either.

{
  "total": 7,
  "list": [
    {
      "id": "5f7c17e84f22f6f68",
      "name": "John3",
    },
    {
      "id": "5f7c1366574bab37c",
      "name": "John2",
    },

… + 5 more result

If I use

total.list

It will be no response

Error: Error: A espo record not found from the response!status: -1

Hi all, I managed to somehow fixed it.

For single collection it need to be left blank. For the relative path you will need to write in
/{id}

But sometime writing it doesn’t work so keep trying till it does, Try using copy/paste, that also help. As I don’t want to post too frequent in this thread I will make making a new thread to documents my experience.