APIs & Integrations

yinonby
Member

tickets.get not working with idProperty

SOLVE

I'm trying to get a ticket using the idProperty, and it's not working. I am testing it using the api simulator in https://developers.hubspot.com/docs/api/crm/tickets, 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.

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

tickets.get not working with idProperty

SOLVE

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

View solution in original post

6 Replies 6
RMones
Solution
Contributor | Platinum Partner
Contributor | Platinum Partner

tickets.get not working with idProperty

SOLVE

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

yinonby
Member

tickets.get not working with idProperty

SOLVE

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

yinonby
Member

tickets.get not working with idProperty

SOLVE

I'm doing a get using the request simulator on the crm tickets doc page (https://developers.hubspot.com/docs/api/crm/tickets)

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

0 Upvotes
tominal
Guide | Partner
Guide | Partner

tickets.get not working with idProperty

SOLVE

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!


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
0 Upvotes
yinonby
Member

tickets.get not working with idProperty

SOLVE

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

,  

0 Upvotes
tominal
Guide | Partner
Guide | Partner

tickets.get not working with idProperty

SOLVE

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.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
0 Upvotes