API
Use TimeTrack Rest API to integrate TimeTrack with other systems.
Happy Coding!
With users endpoint you can:
User object has following params:
| Param | Type | Description |
|---|---|---|
| ID | Integer | ID |
| Text | Unique e-mail address | |
| username | Text | Unique username |
| firstName | Text | First name |
| lastName | Text | Last name |
| personalNumber | Text | Personal number |
| language | Text | Language, allowed values are: de, en |
| hourRate | Text | Hourly rate for labor |
| admin | Boolean | Flag if the user is admin |
| external | Boolean | Flag if the user is external employee / subcontractor etc. |
| teamLead | Boolean | Flag if the user is team lead |
| enabled | Boolean | Flag if the user is enabled or disabled |
curl “https://testaccount.imetrackenterprise.com/api/v2/ext/users/”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
You can use following params for search / filter:
| Param | Type | Description |
|---|---|---|
| username | Text | Username |
| Text | ||
| firstName | Text | First name |
| lastName | Text | Last name |
| enabled | Boolean | Enabled or disabled, allowed true or false, 1 or 0 |
In this example we search for user with username test:
curl “https://testaccount.imetrackenterprise.com/api/v2/ext/users?username=test”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Required params: id.
curl “https://testaccount.imetrackenterprise.com/api/v2/ext/users/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
You can use all user object params to create user.
Required params: username, firstName, lastName, email, password
curl -X “POST” “https://testaccount.imetrackenterprise.com/api/v2/ext/users”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“teamLead”: false,
“password”: “123123123”,
“firstName”: “Max”,
“admin”: true,
“username”: “test6”,
“email”: “test4@test.com”,
“language”: “de”,
“personalNumber”: 1234,
“lastName”: “Smith”
}’
For Update you can use all params of user object except: enabled, username.
curl -X “PUT” “https://testaccount.imetrackenterprise.com/api/v2/ext/users/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“password”: “122122122”,
“admin”: true,
“firstName”: “John”,
“langauge”: “en”,
“email”: “test3_@test.com”
}’
curl -X “DELETE” “https://testaccount.imetrackenterprise.com/api/v2/ext/users/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’