API
Use TimeTrack Rest API to integrate TimeTrack with other systems.
Happy Coding!
With expenses endpoint you can:
Expense object has following params:
Param | Type | Description |
---|---|---|
ID | Integer | ID |
user | Text | Username |
clientName | Text | Client name |
projectName | Text | Project name |
name | Text | Expense name |
price | Number | Price |
quantity | Integer | Quantity |
billable | Boolean | Flag billable or non-billable. Default billable. |
payType | Text | Payed with credit card or cash etc. |
details | Text | Notes |
tags | Text | Hashtags |
date | Text | Timestamp – Format: YYYY-MM-DDTHH:MM:SS.fffZ, Example: 2020-10-20T09:00:00.000Z |
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/expenses/”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
Following params can be used for search / filter:
Param | Type | Description |
---|---|---|
name | Text | Expense name |
projectName | Text | Project name |
clientName | Text | Client name |
user | Text | Username |
from | Text | from, Format: YYYY-MM-DDTHH:MM:SS.fffZ, Example: 2020-10-20T09:00:00.000Z |
to | Text | to, Format: YYYY-MM-DDTHH:MM:SS.fffZ, Example: 2020-10-20T09:00:00.000Z |
In this example we will search for all expenses for user “test” between 2020-10-01 and 2020-10-23
curl “https://testaccount.timetrackenterprise.com/api/v2/ext/expenses?username=test&from=2020-10-01T00:00:00.000Z&to=2020-10-23T23:59:59.999Z””
-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.timetrackenterprise.com/api/v2/ext/expenses/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’
For create method you can use all params of expense object.
Required params: clientName, projectName, user, name, quantity, price, date
curl -X “POST” “https://testaccount.timetrackenterprise.com/api/v2/ext/expenses”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“quantity”: 1,
“price”: 125.5,
“clientName”: “Client 006”,
“date”: “2020-10-20T10:00:00.000Z”,
“username”: “test”,
“projectName”: “Project 006_1”,
“name”: “Flight Ticket”
}’
For update method you can use all params of expense object except: clientName, projectName, user, name.
curl -X “PUT” “https://testaccount.timetrackenterprise.com/api/v2/ext/expenses/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{
“price”: 135.5,
“notes”: “Test notes for API”
}’
curl -X “DELETE” “https://testaccount.timetrackenterprise.com/api/v2/ext/expenses/1”
-H ‘Content-Type: application/json’
-H ‘X-TimeTrack-Api-Secret: <API_SECRET_TOKEN>‘
-H ‘X-TimeTrack-Api-Key: <API_KEY>‘
-d $'{}’