Query in CRM ticket api

I’ve recently used the following API endpoint: https://api.hubapi.com/crm/v3/objects/tickets/:ticketId?limit=10&archived=false

From the response, I am able to retrieve fields like ticket_pipeline, priority, and category. However, I’m keen on extracting other details related to the same ticket ID. Specifically, I’m looking for:

  • Campaign duration
  • Deliverable target
  • Invoice amount
  • Media buy type
  • RO amount
  • Ticket owner
  • Ticket status
  • Unit price

Could anyone guide me on how to adjust the API call or provide guidance on fetching these additional fields? I appreciate any help or insights you can offer.

Thank you in advance!

Hello @Ayush_47,

This can be done by included the “properties” parameter in your request. It contains a comma separated list of properties to return in the response. For instance if I had a ticket with “prop1”, “prop2” and “prop3” I would make a request similar to the below:

GET https://api.hubapi.com/crm/v3/objects/ticket/1606885847?properties=prop1%2Cprop2%2Cprop3
RESPONSE
{
 "id": "1606885847",
 "properties": {
 "createdate": "2023-08-04T09:07:14.627Z",
 "hs_lastmodifieddate": "2023-08-17T20:50:30.997Z",
 "hs_object_id": "1606885847",
 "prop1": "prop1 value",
 "prop2": "prop2 value",
 "prop3": "prop3 value"
 },
 "createdAt": "2023-08-04T09:07:14.627Z",
 "updatedAt": "2023-08-17T20:50:30.997Z",
 "archived": false
}

I hope this helps!

Thannks for help!

Also is there anyway by which i can get the all tickets associated with owners or I can filter the tickets by the owners list i have

Hi @Ayush_47,

You can either retrieve all of the tickets and filter by owner or alternatively use the CRM Search API to search for tickets where owner is equal to X, Y or Z.