List all Employees JSON API
List all Employees JSON API
I would like to get a list of employees using API. I am able to get basic information as in JSON API example. I am interested in capturing Employees First name, last name, phone number and status. just like in the employees tab on Desktop version of Timetrex.
Re: List all Employees JSON API
Please see more information about our API and even a specific example on obtaining employee (user) records from TimeTrex here:
https://www.timetrex.com/workforce-management-api
https://www.timetrex.com/workforce-management-api
Re: List all Employees JSON API
the API only mentions how to get user data when you know something about the user like userid. to get all users you will need to append null.
$user_data = postToURL( buildURL( 'APIUser', 'getUser' ), null);
Re: List all Employees JSON API
By default get*() API calls return all data if you don't pass in any arguments. Arguments are only needed if you want to filter the results to reduce what is returned.
-
- Posts: 17
- Joined: Wed Apr 14, 2010 9:38 am
Re: List all Employees JSON API
Is there an argument for returning the data sorted by 'last_name', 'first_name', 'middle_name'? I can sort it in PHP but I'm wondering if it would be faster and more streamline for my use if it came already in the order I want to display it.
Rois
Rois
Re: List all Employees JSON API
Yes, I would recommend using the API Tracing functionality described here:
https://www.timetrex.com/workforce-management-api
Then go to Employee -> Employees and create the exact list you want, with the columns and sorting specified, then you can see the API call that is being used and copy that to your own code. Keep in mind you can click on any list column headers in TimeTrex while holding the CTRL button to sort multiple columns at once. Or use the "Saved Search & Layout" tab "Sort By" dropdown box instead.
https://www.timetrex.com/workforce-management-api
Then go to Employee -> Employees and create the exact list you want, with the columns and sorting specified, then you can see the API call that is being used and copy that to your own code. Keep in mind you can click on any list column headers in TimeTrex while holding the CTRL button to sort multiple columns at once. Or use the "Saved Search & Layout" tab "Sort By" dropdown box instead.
-
- Posts: 17
- Joined: Wed Apr 14, 2010 9:38 am
Re: List all Employees JSON API
Thank you. That was exactly what I needed.