APIs & Integrations

Stanza
Member

Deal Search API - filtering last modified date

SOLVE

Hi,

 

I have the search API:

 

https://api.hubapi.com/crm/v3/objects/deals/search?hapikey=[API_KEY]

 

 

 

{
    
    "filterGroups": [
        {
            "filters": [
                {
                    "value": "7695775",
                    "operator": "EQ",
                    "propertyName": "dealstage"
                },
                {
                    "value": "hs_lastmodifieddate",
                    "operator": "GTE",
                    "propertyName": "1638316800"
                }
            ]
        }
    ],
    "properties": [
        "dealname"
    ]
}

 

 

I get the following error:

 

 

{
    "status": "error",
    "message": "There was a problem with the request.",
    "correlationId": "24709551-9717-4d21-b969-f4a2442ac88e"
}

 

 

I have tried seconds and milliseconds but get the same error.

Any ideas ?

I have tried using the epoch time converter but no luck.

0 Upvotes
1 Accepted solution
RMones
Solution
Contributor | Platinum Partner
Contributor | Platinum Partner

Deal Search API - filtering last modified date

SOLVE

Hi @Stanza ,

 

You have to swap the value and propertyName. You mixed the value and propertyName aths_lastmodifieddate:

{
"value": "hs_lastmodifieddate",
"operator": "GTE",
"propertyName": "1638316800"
}

 

to

{
"propertyName": "hs_lastmodifieddate",
"operator": "GTE",
"value": "1638316800"
}

 

Regards, Ronald

View solution in original post

3 Replies 3
Stanza
Member

Deal Search API - filtering last modified date

SOLVE

yes - have sorted this oiut - there were multiple tickets from me about this - I have to created another one since the first got tagged as spam - dunno why.

0 Upvotes
RMones
Solution
Contributor | Platinum Partner
Contributor | Platinum Partner

Deal Search API - filtering last modified date

SOLVE

Hi @Stanza ,

 

You have to swap the value and propertyName. You mixed the value and propertyName aths_lastmodifieddate:

{
"value": "hs_lastmodifieddate",
"operator": "GTE",
"propertyName": "1638316800"
}

 

to

{
"propertyName": "hs_lastmodifieddate",
"operator": "GTE",
"value": "1638316800"
}

 

Regards, Ronald

dennisedson
Community Manager
Community Manager

Deal Search API - filtering last modified date

SOLVE

Spot on @RMones !

Also, make sure you are working with a unix timestamp in milliseconds!

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show