APIs & Integrations

kizus
Participant

Filter contacts by id

SOLVE

Hello everyone, 

I am trying to filter/get a contact using the endpoint

POST/crm/v3/objects/contacts/search

 

I am building the request like that:

 

 

 

{
    "filters": [
        {
            "operator": "EQ",
            "propertyName": "id",
            "value": "7951"
        }
    ]
}

 

 

 

 

However, this returns an error like

 

 

 

{
    "status": "error",
    "message": "There was a problem with the request.",
    "correlationId": "a517c46c-c5ec-4057-8cdd-03954b3d6fbe"
}

 

 

 

Some weeks ago, filtering by the id like that was working. Right now it is not.

Now changing the filter to consider another property, filtering by email for example, the request is well succeded. What is wrong? Can someone help me/w

0 Upvotes
1 Accepted solution
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Filter contacts by id

SOLVE

Hello @kizus  , thank you for writing!
I think that the propertyName of the contact id is actually vid so your code should look like below:

 

 

{
    "filters": [
        {
            "operator": "EQ",
            "propertyName": "vid",
            "value": "7951"
        }
    ]
}

 

 

 
If my answer was helpful please mark it as a solution.

View solution in original post

0 Upvotes
2 Replies 2
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Filter contacts by id

SOLVE

Hello @kizus  , thank you for writing!
I think that the propertyName of the contact id is actually vid so your code should look like below:

 

 

{
    "filters": [
        {
            "operator": "EQ",
            "propertyName": "vid",
            "value": "7951"
        }
    ]
}

 

 

 
If my answer was helpful please mark it as a solution.

0 Upvotes
kizus
Participant

Filter contacts by id

SOLVE

Hello @miljkovicmisa , thanks by your answer. I tested your suggestion and it really works.

I found out another way to filter by the contact id using the property hs_object_id, like that

{
    "filters": [
        {
            "operator": "EQ",
            "propertyName": "hs_object_id",
            "value": "7951"
        }
    ]
}


So thank you!