{"id":533,"date":"2025-04-09T12:24:53","date_gmt":"2025-04-09T12:24:53","guid":{"rendered":"http:\/\/gogetmuscle.com\/?p=533"},"modified":"2025-04-09T17:39:40","modified_gmt":"2025-04-09T17:39:40","slug":"check-ticket-status-associated-with-contact-id-returning-429","status":"publish","type":"post","link":"http:\/\/gogetmuscle.com\/index.php\/2025\/04\/09\/check-ticket-status-associated-with-contact-id-returning-429\/","title":{"rendered":"Check ticket status associated with contact id returning 429"},"content":{"rendered":"

Hello, I’m facing a status 429 issue when checking the status of tickets associated with a contact via the API. I need to return only the open ticket associated with a phone number, if any.<\/P>

I couldn’t find a way in the HubSpot API to return only the ID of the ticket associated with a contact id that is open on the platform. The only way I could find to do this is to query all tickets (open or closed) associated with a contact’s ID. The problem is that if the contact has many closed tickets, I need to send several requests to the hubpost api individually passing the ticket id associated with a contact to check the hs_pipeline_stage of each of these tickets to verify if the ticket is open, but if I send more than 10 requests within 1 second, I am temporarily banned by the hate limit with the following response in the request:

<\/P>

data: {
status: ‘error’,
message: ‘You have reached your ten_secondly_rolling limit.’,
errorType: ‘RATE_LIMIT’,
correlationId: ‘2507e73d-4339-4705-83ee-dc446341d6a9’,
policyName: ‘TEN_SECONDLY_ROLLING’,
groupName: ‘publicapi:private_app-api-calls-ten-secondly:3595377:44357029’ }<\/P>


Here is the flow of my nodejs api to search for an open ticket in hubspot:<\/P>

First I return all tickets associated with a contact’s id:

<\/P>

Request:
curl –location ‘https:\/\/api.hubapi.com\/crm\/v3\/objects\/contacts\/109384404784\/associations\/tickets<\/a>‘

<\/P>

Response:
{
“results”: [
{
“id”: “21848207900”,
“type”: “contact_to_ticket”
},
{
“id”: “21848535583<\/STRONG>“,
“type”: “contact_to_ticket”
}
]
}

<\/P>

Then I need to query each ticket id to check the value of hs_pipeline_stage<\/P>

Request:
curl –location ‘
https:\/\/api.hubapi.com\/crm\/v3\/objects\/tickets\/21848535583<\/STRONG><\/a>‘

<\/P>

Response:
{
“id”: “21848535583<\/STRONG>“,
“properties”: {
“content”: null,
“createdate”: “2025-03-28T12:17:33.566Z”,
“hs_lastmodifieddate”: “2025-03-28T12:17:45.848Z”,
“hs_object_id”: “21848535583”,
“hs_pipeline”: “0”,
hs_pipeline_stage<\/STRONG>“: “1”,
“hs_ticket_category”: null,
“hs_ticket_priority”: “HIGH”,
“subject”: “Test”
},
“createdAt”: “2025-03-28T12:17:33.566Z”,
“updatedAt”: “2025-03-28T12:17:45.848Z”,
“archived”: false
}

How to return only the open ticket id associated with the contact id?<\/P>

\u00a0<\/DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"

Hello, I’m facing a status 429 issue when checking the status of tickets associated with a contact via the API. I need to return only the open ticket associated with a phone number, if any.I couldn’t find a way in the HubSpot API to return only the ID of the ticket associated with a contact […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/533"}],"collection":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":1,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"predecessor-version":[{"id":534,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/533\/revisions\/534"}],"wp:attachment":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}