Check ticket status associated with contact id returning 429
SOLVE
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:
Check ticket status associated with contact id returning 429
SOLVE
Hey, @ARobson8👋 Have you already ruled out using the Search API? I know the pseudo-association options don't always work like folks expect, but in this case, we might be able to get you closer. You may need to build in an exponential backoff, regardless of what you end up using, but we can cross that bridge in the future.
It's not a perfect solution. For one, you'll need to either store the Contact's phone number as a custom Ticket property to have it returned in this response, since we are making a request to Tickets and not Contacts.
Talk soon! — Jaycee
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Check ticket status associated with contact id returning 429
SOLVE
I need to get the hs_pipeline_stage because I check in the client's custom statuses for tickets if there is a match with the ids to know if a ticket is open or closed. Here is an example:
Request executed only once to check the custom hs_pipeline_stage of the client crm :
Check ticket status associated with contact id returning 429
SOLVE
Hey, @ARobson8👋 Have you already ruled out using the Search API? I know the pseudo-association options don't always work like folks expect, but in this case, we might be able to get you closer. You may need to build in an exponential backoff, regardless of what you end up using, but we can cross that bridge in the future.
It's not a perfect solution. For one, you'll need to either store the Contact's phone number as a custom Ticket property to have it returned in this response, since we are making a request to Tickets and not Contacts.
Talk soon! — Jaycee
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.