APIs & Integrations

jgoldby
Member

POST contacts/search test response does not return "results"

Hi,

 

When I use the "test call" feature in the API docs for contacts,

 

I get this response body -

 

{
"total": 3,
"results": [],
"paging": {
"next": {
"after": "0"
},
"prev": null
}
}

 

I get "total 3" but the results array is empty.... am I missing some configuration somewhere in the request?

 

Thank you

0 Upvotes
7 Replies 7
johnnydrews
Participant

POST contacts/search test response does not return "results"

Thanks @dennisedson , I made edits to my body and got desired result

dennisedson
HubSpot Product Team
HubSpot Product Team

POST contacts/search test response does not return "results"

Glad it worked out @johnnydrews .  What did you change?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

POST contacts/search test response does not return "results"

@johnnydrews  (and @jgoldby.  apologies for missing the follow up on this for you),

I am able to successfully send a test request via the docs. 

This is what it looks like

 

curl --request POST \
  --url 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=xxx' \
  --header 'content-type: application/json' \
  --data '{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "firstname",
          "operator": "HAS_PROPERTY"
        }
      ]
    }
  ],
  "sorts": [
    "firstname"
  ],
  "properties": [
    "firstname"
  ],
  "limit": 5,
  "after": 0
}'

 

this is the response:

 

HTTP 200

{
  "total": 8,
  "results": [
    {
      "id": "26051",
      "properties": {
        "createdate": "2021-02-05T14:58:34.203Z",
        "firstname": "cats",
        "hs_object_id": "26051",
        "lastmodifieddate": "2021-03-18T13:31:13.681Z"
      },
      "createdAt": "2021-02-05T14:58:34.203Z",
      "updatedAt": "2021-03-18T13:31:13.681Z",
      "archived": false
    },
    {
      "id": "22151",
      "properties": {
        "createdate": "2021-01-11T21:19:08.401Z",
        "firstname": "Dan",
        "hs_object_id": "22151",
        "lastmodifieddate": "2021-05-18T18:07:02.539Z"
      },
      "createdAt": "2021-01-11T21:19:08.401Z",
      "updatedAt": "2021-05-18T18:07:02.539Z",
      "archived": false
    },
    {
      "id": "25951",
      "properties": {
        "createdate": "2021-02-05T14:52:04.407Z",
        "firstname": "dog",
        "hs_object_id": "25951",
        "lastmodifieddate": "2021-05-12T17:26:10.398Z"
      },
      "createdAt": "2021-02-05T14:52:04.407Z",
      "updatedAt": "2021-05-12T17:26:10.398Z",
      "archived": false
    },
    {
      "id": "43801",
      "properties": {
        "createdate": "2021-06-10T14:07:03.954Z",
        "firstname": "larry",
        "hs_object_id": "43801",
        "lastmodifieddate": "2021-07-12T17:30:16.318Z"
      },
      "createdAt": "2021-06-10T14:07:03.954Z",
      "updatedAt": "2021-07-12T17:30:16.318Z",
      "archived": false
    },
    {
      "id": "21551",
      "properties": {
        "createdate": "2020-12-28T20:27:38.133Z",
        "firstname": "newby",
        "hs_object_id": "21551",
        "lastmodifieddate": "2021-04-11T03:44:06.539Z"
      },
      "createdAt": "2020-12-28T20:27:38.133Z",
      "updatedAt": "2021-04-11T03:44:06.539Z",
      "archived": false
    }
  ],
  "paging": {
    "next": {
      "after": "5"
    }
  }
}

 

Would either of you be able to send me a screenshot, video or something of exactly what you are using for your body?

0 Upvotes
johnnydrews
Participant

POST contacts/search test response does not return "results"

@dennisedson I'm having the same issue. How should dev resolve problem?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

POST contacts/search test response does not return "results"

Hi @jgoldby !

Could you link to the specific endpoint you were using?

 

Thanks!

 

0 Upvotes
jgoldby
Member

POST contacts/search test response does not return "results"

0 Upvotes
jgoldby
Member

POST contacts/search test response does not return "results"

Hi @dennisedson , any update to this issue?

 

Thank you