All,
Can someone please shed some light on how to retrieve all fields of a ticket? I’m using POSTMAN and I’ve made a GET call to the address below:
https://api.hubspot.com/crm/v3/objects/tickets/1569140281
(where 1569140281 is a existing ticket)
This returns the snippet below. The return is just a handful of fields, I assume all HS default fields. (create date / pipeline etc.) I would like to return the value of user created fields (by us). Example we have a field “Quote Number” (quote_number)
Two things:
1. How can I retrieve that field value if I know the ticket number?
2. How can I retrieve the ticket number if I know only the quote number?
Hey @SMCNULTY
You’ll want to pass the desired ticket properties to the GET endpoint as a query parameter:
GET
/crm/v3/objects/tickets/{ticketId}?properties=custom_property1,custom_property2,etc
Hope this gets you moving!
Excellent thank you! I was able to pull the quote_number field from a associated ticket. Now, possibly the more challenging request, how to I retrieve an associated ticket # if I just know the quote number?
I ask because we are working with new call center software. Their development team says they can help retrieve HS tickets based on user-input from the phone keypad.
Example customer enters their ticket number (easy) or they enter their “quote number” or “PO number” (both user created fields in HS) and the associated ticket should pop up in their phone system GUI.
I should note they are requiring that I test all the API calls in POSTMAN to make sure they work before passing to their development team. No they’re not paying me to do their work…
Yikes! Best we can do is enable them to do their work best! As far as my suggestions you can test either easily in Postman!
And pardon I missed your second question! To get a ticket via a custom property on a ticket you could use the search API to search tickets with a matching property.
POST
/crm/v3/objects/tickets/search
And more documentation here.
Hope this gets you moving!
Well I replied to this last night but it doesn’t seem to have stuck. Anyway, I’m 98% of the way there. I was able to get the search function to work by putting the search criteria in the body of the post call in Postman. Is there anyway to put all these details in the API URL?
In this example, I found a real value for our “PO NUMBER” (P_O_) which was 3702382 and Postman returned the correct ticket details. Can the property name and value be in the actual URL? (I copied this off the web, I don’t even know what the “operator” field is)
Hey @SMCNULTY
- I don’t believe that you can reduce the POST request to a single URL, but I could be wrong!
- The operator property is a special symbol or token used to perform operations on operands (values and variables stored as properties on the ticket). With the search api it tells the API how to compare the object being search with the properties being provided in the body.
- “value” is whats we are attemptng to match.
In your example:
- we are comparing if the ticket object’s property “p_o_” id is “EQUAL” to “370232”.
See the HS operators here.
excellent thank you. For now I will send what I did with the body over to this company. If anyone else knows if this can be appended to the API URL please let me know.
I appreciate your help with this!
OK great, I’m 99% of the way there. Below is what I did in postman. I passed the quote number in the body of the POSTMAN request and in the return results was a select group of info, the ticket ID being the most important.
Two things:
1. Is it possible to append what I put in the body to the end of the API URL instead?
2. I copied this bit of code from the web, what is “Operator”: “EQ” in the BODY?