Tickets with associated records

Hello,

Using the api, I’m trying to make one call to return all tickets in a date range and include the associated customerid and assigned userid.

Thank you!

Nick

Hi @NMetnik ,

Would you mind sharing the purpose of this call? I would love to have more context to ensure I am providing you with the correct solution.

Thank you!

Hello JWingate2,

Thank you. Yes. I need the Company Id and Name from the Company association and I need the Contact Id of the Ticket owner which it appears comes from the Contacts association. See attached.

Again I’m calling the api but previous screenshot was to demonstrate what fields I need to include. I’m also using. c# but can adapt any code response.

Hey @NMetnik :waving_hand: You are not missing an additional option. Using the REST API endpoints, we cannot do this in a single unified request. You’ll need to either:

  • make multiple calls and process the data externally
  • use our GraphQL endpoint, which allows you to one-shot these requests in the manner you want

Unfortunately, I do not have a third option for this challenge, as the Search API is powerful but won’t return associations the way you need it to for this project.

Best,

Jaycee

Thank you Jaycee. Bummer, but I’ll run in this direction and I appreciate you letting me know it’s not possible.

Hi @NMetnik ,
I’m not sure, but @Anton might be able to help. I am not sure, I understand why you are doing an API call to collect this data. I believe you should be able to create a report and get this data, but I might be missing something as well.

Gotcha! API docs can be a bit much.

Are you trying to build a report or pull this into something like Sheets or a dashboard?

Here’s the quick win:
Use the /tickets/search endpoint with a date filter on createdate, and include associations for contacts, companies, and owners. That’ll give you ticket data plus the contact ID, owner ID, and company ID in one go.

You’d still need to make follow-up calls if you want names instead of just IDs. I usually batch those in a script when I need more detail. Want help with that part?