tickets.get not working with idProperty

I’m trying to get a ticket using the idProperty, and it’s not working. I am testing it using the api simulator in Accounts Dashboard | HubSpot, and I’m putting a valid api key, a valid property name, and a property value, for which an existing ticket is supposed to be matched, but it doesn’t work.

Do I need to mark this property as an “ID” property? If so, how can I do that? I don’t see any way in the property edit form.

Hi @yinonby,
Which endpoint are you using? There’s the GET request and you have to specify the ticketId. There’s also the Search CRM POST request and that’s where I am guessing you are specifying the property name and value.

I’m doing a get using the request simulator on the crm tickets doc page (Accounts Dashboard | HubSpot)

We’ll say my idProperty is called id-prop-name (it’s a custom property), and its value is 1234, so in the ticketId I put “1234”, and in the idProperty I put “id-prop-name”.

And the request fails with HTTP 404

Ah I see now. You won’t be able to use the GET request with a custom property. You’ll have to use the Search CRM request. It’s 3 requests below that in the documentation.

/crm/v3/objects/tickets/search


There you can do a POST request to search for a ticket matching your custom property value.
Hope that helps!

I actually tried that one as well, and it returned 0 results, though there is a matching ticket.

This is how it generated the request options:

var options = {
 method: 'POST',
 url: 'https://api.hubapi.com/crm/v3/objects/tickets/search',
 qs: {hapikey: '**************************'},
 headers: {accept: 'application/json', 'content-type': 'application/json'},
 body: {
 filterGroups: [
 {
 filters: [
 {
 value: '1234',
 propertyName: 'my-prop-name',
 operator: 'EQ'
 }
 ]
 }
 ],
 sorts: ['string'],
 query: 'string',
 properties: ['string'],
 limit: 5,
 after: 0
 },
 json: true
};

,

Hi,
I think you don’t get results because of the sorts, query and properties you mentiond are not valid.

Remove them from your request and try again.

Regards,

Ronald

Hmm nice, they were autopopulated by the simulator, but I set them properly and it works