Api to collect user and the number of tickets they have
Hi.
I was now trying like 30 mins to find the right spot to ask this questions, but failed... Anyways:
We want to use your [support] rest api to get all the users and their "status" to display them in our internal portal.
Currently we collect all the tickets, sideload the users and construct from this an object like this:
[{
user@email.com: {
openTickets: 5,
closedTickets: 10,
resolvedTickets: 4
}, {...}
}]
This is pretty bad because this request is super big and takes lot's of time. (We do it on a daily base). Is there any api endpoint that I can user to get the user and the number of tickets (different status of the tickets they are in) all at once?
I guess something like this must exist, because lot's of other companies also drive metrics on these data..?
Thanks
Christian
-
Hi Christian-
I don't believe an endpoint to accomplish this precise use-case exists, though I am still looking through our docs in order to give you an efficient suggestion. One supported sideload is
open_ticket_count
, and I am wondering if this might be useful to you. -
Hi Joseph,
what do you mean with this? I was hoping to query the user and then, for each user, automatically get the infos mentioned above as a sideload.
With the open_ticket_count as a sideload, I guess I can query all the users and get the number of open tickets. This is nice, but I need more precise infos like how many open, closed etc.
Beside of this, I'm wondering if there's a way to tell the ticket list endpoint that I just need a few attributes of the ticket, not everything (to save bandwidth).
How does other ppl solve those cases?
-
To sum it up, these are the most important questions:
1) Is there a better way to accomplish the json structure mentioned in my first post than read all the tickets, sideload the users and build it from there.
2) If there is no better way, is there at least a way to tell the api to only send some attributes of the tickets to me, not all of them?And a Bonus questions.
Do I ever get ALL the tickets (apart from those that are archived) or is there a max date which I'm allowed to query?
Thanks
Christian
-
Hi Christian-
Not really, and this is a common gripe with RESTful APIs, the all or nothing nature of the response. There isn't a "cafeteria-style" option to pick & choose.
As far as getting all tickets, there isn't a max date. I don't know exactly what data you need in the response, but our incremental ticket export for example can have astart_time
value of when you opened your account, and would begin GETting the tickets from that point.
댓글을 남기려면 로그인하세요.
4 댓글