I have a question about the query made by API. First, a brief explanation of the process.
I have a PHP project where the main page returns all tickets created in the current month. For this I use the URL "api/v2/search.json?query=created>2019-05-01 created<2019-05-16 order_by:created sort:desc type:ticket".
I put the fill of a table with some information like:
Ticket number (id);
Creation date (created_at);
Closing date (updated_at);
User email that opened;
Before filling in this table, the page executes a function in PHP that takes all registered organizations and creates an array that writes the index as the ID of that organization and how the value, the name of that organization (I thought in this way to avoid using multiple requisitions ).
After picking up information from organizations, I fill in the table according to the information that comes back from that URL.
At the time of writing the name of the organization of that ticket, I consult this array and get the information.
The problem I'm having is when it comes to picking the name of the user who opened it and the email. At the time of putting this information in the table, I run another function in PHP that uses the following URL "api/v2/users/id_user.json role:end-user" to get the user information (name and email) and put it in an array.
This entire process takes about a minute (approximately 85 tickets). If I do not get the user information, the screen fill is almost instantaneous.
My question, is it possible to limit what information I want to return from a ticket and a user? (for the query to return less information and to leave faster)
Thanks for any tips on how to streamline these queries.
Please sign in to leave a comment.