7pace Timetracker REST CRUD API Version 3
7pace Timetracker supports CRUD API. This means that you can create, read, update, and delete worklogs.
The CRUD API also lets you get information about the following:
Current and other Timetracker users
User roles and assigned licenses (and to manage it)
Activity types
Approval state of weeks
All the available endpoints in the 7pace Timetracker REST CRUD API can be found in our API Reference: REST CRUD API Reference.
On this page:
|
|---|
Connecting to API
Connecting to the REST CRUD API is the same process as connecting to the 7pace Reporting API, which is described here: Connecting to API.
Important information
The REST CRUD API returns results in batches (usually of up to 500 rows). If your results contain more than 500 rows, you must use the $skip and $count parameters. The maximum value for the $count parameter is 500.
API endpoints overview
All endpoint information can be found in the 7pace Timetracker API Reference page, along with all the fields returned by the endpoints, and the parameters that can be used with each endpoint. The following endopints are available:
GET
me- get information about yourselfusers- get list of system usersusers/roles- get list of 7pace Timetracker licensed users with roles/permissionsactivityTypes- get information about activity type state in the systemworkLogs- gets list of worklogs for current userworkLogs/all- gets list of worklogs for whole systemtimeApproval/all- gets list of time approval for whole system
POST
users/roles- set roles/permissions for the list of 7pace Timetracker licensed usersworkLogs- creates new worklogworkLogs/batch- creates batch of new worklogstimeApproval/week- send week for approval
PATCH
workLogs/{id}- updates worklog
DELETE
workLogs/{id}- deletes worklog from systemtimeApproval/week- revoke week that is in a submitted state
me
This endpoint allows you to get information about yourself.
It is possible to use the $expand parameter with this endpoint. The possible options are { user.displayName }.
users
This endpoint returns a list of all 7pace Timetracker system users. The parameters that can be used with this endpoint are $count, $skip and $expand. The possible options for the $expand parameter are { user.displayName }.
users/roles
This endpoint can be used to get a list of 7pace Timetracker licensed users with their roles. By using the POST command, the user roles can be set. The parameters that can be used with this endpoint are includeNoneRoles, $count, $skip and $expand. The possible options for the $expand parameter are { user.displayName }.
User can be specified by id, vstsId or email (only one field is required) and the role can be specified by id or name (only one field is required).
activityTypes
This endpoint can be used to get information about the activity type state in the system.
workLogs
This endpoint can be used to get a list of worklogs for the current user, or by using the POST command, a new worklog can be created. The below parameters can be used with this endpoint:
$count - Number of items to take. Maximum value: 500
$skip - Number of items to skip
$expand - The expand parameters for model attributes. Possible options are { user.displayName }
$workItemIds - Filter worklogs by Work Item Ids. Comma separated array, no more than 100 at once
$fromTimestamp - Return worklogs with timestamp greater than value.
$toTimestamp - Return worklogs with timestamp less than value.
$fromCreatedTimestamp - Return worklogs with created timestamp greater than value
$toCreatedTimestamp - Return worklogs with created timestamp less than value
Date format example: 2021-11-06T10:28:00
timeApproval
This endpoint can be used to send a week for approval (POST) or to revoke a week that has been submitted for approval (DELETE). Using this endpoint requires at least the Team user role in 7pace Timetracker.
By using the timeApproval/all endpoint you can get a list of time approval for the entire system and get all approval information. This requires the Approval Manager rights. timeApproval has an approval state of the specific weeks and has a date range of [weekStartDate - weekEndDate], while the worklog record has one exact date (createdTimestamp). By matching createdTimestamp from the worklogs for which you are looking to the specific timeApproval weeks with the corresponding date range [weekStartDate - weekEndDate], you can find the approval state of these worklogs. If there are no results, all available approval weeks in the system are in an unsubmitted state. The parameters which can be used with the timeApproval/all endpoint are listed below:
$count - Number of items to take. Maximum value: 500
$skip - Number of items to skip
$expand - The expand parameters for model attributes. Possible options are { user.displayName }
$fromTimestamp - Return time approval with week date that includes current week or greater than value.
$toTimestamp - Return time approval with a week date that includes the current week or less than value.
Date format example: 2021-12-06T12:35:00