GOGETMUSCLE Community Check ticket status associated with contact id returning 429

Check ticket status associated with contact id returning 429

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 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:

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’ }


Here is the flow of my nodejs api to search for an open ticket in hubspot:

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

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

Response:
{
“results”: [
{
“id”: “21848207900”,
“type”: “contact_to_ticket”
},
{
“id”: “21848535583“,
“type”: “contact_to_ticket”
}
]
}

Then I need to query each ticket id to check the value of hs_pipeline_stage

Request:
curl –location ‘https://api.hubapi.com/crm/v3/objects/tickets/21848535583

Response:
{
“id”: “21848535583“,
“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“: “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?

Leave a Reply

Your email address will not be published.

Related Post