Our API provides a way to track time using HTTP post calls. Our widgets use this interface, but third-party developpers can also use this to write programs which interact with the TrackMyPeople engine. It can be used in any programming language with HTTP post & SSL support.
We use http authentication over an ssl connection. You just have to provide your username and password.
We provide the following functions:
back to topThis function lists all trackers the authenticated user can track for. These are all trackers where the user has a role which has the 'can track'-permission. The list is returned alphabetically and in tree form, iow preceeded by a number of arrows so you'd get an indented tree.
View Live JSON Example$tracker_name $tracker_name ... ...
{
$tracker_id: $tracker_name,
$tracker_id: $tracker_name,
...
...
}
This is a very usefull function. For example, using this you can determine what buttons to show (start or stop, etc...), whether a block is already opened when logging in through a widget, and so on...
View Live JSON Example1 (OR 0 = already started)$day_total_all_trackers UNIX timestamp $tracker_day_total $last_blocks_tracker_id $last_blocks_tracker_name $last_blocks_tracker_abbreviation 1 (OR 0)$default_tracker_id $default_tracker_name $default_tracker_abbreviation 1 (OR 0)
{
result: 1,
daytotal: $day_total_all_trackers,
last_block: {
started_at: "UNIX timestamp",
total: "$tracker_day_total",
tracker: {
Id: $last_blocks_tracker_id,
Name: "$last_blocks_tracker_name",
Abbreviation: "$last_blocks_tracker_abbreviation"
Trackable: 1 OR 0
}
}
default_tracker: {
Id: $default_tracker_id
Name: "$default_tracker_name"
Abbreviation: "$default_tracker_abbreviation"
Trackable: 1 OR 0
}
}
Starts a new block for the authenticated user. If no tracker_id is passed, the user's default tracker will be taken.
[tracker_id]
View Live JSON Example1 (OR 0 = already started)$day_total_all_trackers UNIX timestamp $tracker_day_total $last_blocks_tracker_id $last_blocks_tracker_name $last_blocks_tracker_abbreviation 1 (OR 0)
{
result: 1,
daytotal: $day_total_all_trackers,
last_block: {
started_at: "UNIX timestamp",
total: "$tracker_day_total",
tracker: {
Id: $last_blocks_tracker_id,
Name: "$last_blocks_tracker_name",
Abbreviation: "$last_blocks_tracker_abbreviation"
Trackable: 1 OR 0
}
}
}
Stops current running time block and starts a new one for the given tracker_id. If no tracker_id is passed, the user's default tracker will be used.
[tracker_id], [description]
View Live JSON Example1 (OR 0 = user was not started)$day_total_all_trackers UNIX timestamp $tracker_day_total $last_blocks_tracker_id $last_blocks_tracker_name $last_blocks_tracker_abbreviation 1 (OR 0)
{
result: 1,
daytotal: $day_total_all_trackers,
last_block: {
started_at: "UNIX timestamp",
total: "$tracker_day_total",
tracker: {
Id: $last_blocks_tracker_id,
Name: "$last_blocks_tracker_name",
Abbreviation: "$last_blocks_tracker_abbreviation"
Trackable: 1 OR 0
}
}
}
Stops the current running block for the authenticated user.
[description]
View Live JSON Example1 (OR 0 = already stopped)
{
result: 1
}
Returns total time for today's blocks (started today).
Note: this total is also returned when starting or switching, and when calling the status action.
View Live JSON Exampleinteger
{
total: "integer"
}
This function can be used to add time for the authenticated user.
A little explanation about the parameters:
All validation is done by the server so you could get an error message included in the error tag, for example because start is after stop.
A special error is thrown when the new block would cause an overlap. In this case an url tag is also returned in the reponse containing the edit-url for the overlapped block.
start, [stop], [tracker_id], [description]
View Live JSON Example1 $added_blocks_id $authenticated_users_profile_id $added_blocks_tracker_id $added_blocks_description $added_block_time_in (in Y-m-d H:i:s format)$added_block_time_out (in Y-m-d H:i:s format)$added_block_total
{
result: 1
added_block:
{
Id: $added_blocks_id
ProfileId: $authenticated_users_profile_id
TrackerId: $added_blocks_tracker_id
Description: $added_blocks_description
TimeIn: "$added_block_time_in" (in Y-m-d H:i:s format)
TimeOut: "$added_block_time_out" (in Y-m-d H:i:s format)
Total: $added_blocks_total
Free: false
}
}
This function can be used to add free time blocks for the authenticated user.
A little explanation about the parameters:
hours, [date], [tracker_id], [description]
View Live JSON Example1 $added_blocks_id $authenticated_users_profile_id $added_blocks_tracker_id $added_blocks_description $added_block_time_in (in Y-m-d H:i:s format)$added_block_time_out (in Y-m-d H:i:s format)$added_block_total 1
{
result: 1
added_block:
{
Id: $added_blocks_id
ProfileId: $authenticated_users_profile_id
TrackerId: $added_blocks_tracker_id
Description: $added_blocks_description
TimeIn: "$added_block_time_in" (in Y-m-d H:i:s format)
TimeOut: "$added_block_time_out" (in Y-m-d H:i:s format)
Total: $added_blocks_total
Free: true
}
}
This function lists all profiles you can see reporting for, which means: all profiles that are related to a tracker where you have the canSeeReporting permission.
View Live JSON Example$id $title $first_name $last_name $phone $gsm $timezone $culture $default_tracker_id ... ... $id $title $first_name $last_name $phone $gsm $timezone $culture $default_tracker_id
{
reportee_$profileid: {
Id: $id
Title: "$title"
Namefirst: "$first_name"
Namefamily: "$last_name"
Email: "$email"
Phone: "$phone"
Gsm: "$gsm"
Timezone: "$timezone"
Culture: "$culture"
DefaultTrackerId: $default_tracker_id
}
reportee_$profileid: {
Id: $id
Title: "$title"
Namefirst: "$first_name"
Namefamily: "$last_name"
Email: "$email"
Phone: "$phone"
Gsm: "$gsm"
Timezone: "$timezone"
Culture: "$culture"
DefaultTrackerId: $default_tracker_id
}
...
...
}
This function gives you reporting capabilities. It'll return a list of blocks matching your given criteria.
There are a few parameters, none are required:
[profile_id], [tracker_id], [start], [stop], [timezone], [free], [include_open]
View Live JSON Example$blocks_id $blocks_profile_id $blocks_tracker_id $blocks_description $blocks_time_in $blocks_time_out $blocks_total 1 ... ... $blocks_id $blocks_profile_id $blocks_tracker_id $blocks_description $blocks_time_in $blocks_time_out $blocks_total
{
block_$blockid: {
Id: $blocks_id
ProfileId: $blocks_profile_id
TrackerId: $blocks_tracker_id
Description: "$blocks_description"
TimeIn: "$blocks_time_in"
TimeOut: "$blocks_time_out"
Total: $blocks_total
Free: true
}
block_$blockid: {
Id: $blocks_id
ProfileId: $blocks_profile_id
TrackerId: $blocks_tracker_id
Description: $blocks_description
TimeIn: "$blocks_time_in"
TimeOut: "$blocks_time_out"
Total: $blocks_total
Free: false
}
...
...
}
This function checks if there's a new widget version for your platform.
The version parameter should be "platform"+"_"+"version", e.g. Windows_Y-1.1.1
version
View Live JSON Example1 OR0 $update_url OR0 invalid version passed: $version
{"result":1} //most-recent version
OR
{"result":0,"url":"$update_url"}
OR
{"result":0,"error":"invalid version passed: $version"}