{"id":13106,"date":"2020-10-30T13:05:33","date_gmt":"2020-10-30T12:05:33","guid":{"rendered":"https:\/\/wpstaging.timetrackapp.com\/api\/api-timer\/"},"modified":"2023-03-01T12:36:40","modified_gmt":"2023-03-01T11:36:40","slug":"timer","status":"publish","type":"page","link":"https:\/\/wpstaging.timetrackapp.com\/en\/api\/timer\/","title":{"rendered":"API &#8211; Timer"},"content":{"rendered":"\n<style type=\"text\/css\" data-created_by=\"avia_inline_auto\" id=\"style-css-av-k6jj58ve-4d1f16dc3a5c8647855d83f7f4eaf395\">\n.avia-section.av-k6jj58ve-4d1f16dc3a5c8647855d83f7f4eaf395{\nbackground-repeat:no-repeat;\nbackground-image:url(https:\/\/wpstaging.timetrackapp.com\/wp-content\/uploads\/2020\/02\/img_are_you_freelancer.jpg);\nbackground-position:50% 50%;\nbackground-attachment:scroll;\n}\n.avia-section.av-k6jj58ve-4d1f16dc3a5c8647855d83f7f4eaf395 .av-section-color-overlay{\nopacity:1;\n}\n<\/style>\n<div id='call-to-action'  class='avia-section av-k6jj58ve-4d1f16dc3a5c8647855d83f7f4eaf395 main_color avia-section-large avia-no-border-styling  avia-builder-el-0  el_before_av_four_fifth  avia-builder-el-first  avia-bg-style-scroll av-section-color-overlay-active container_wrap fullsize'  data-section-bg-repeat='no-repeat'><div class=\"av-section-color-overlay-wrap\"><div class=\"av-section-color-overlay\"><\/div><div class='container av-section-cont-open' ><main  role=\"main\" itemprop=\"mainContentOfPage\"  class='template-page content  av-content-full alpha units'><div class='post-entry post-entry-type-page post-entry-13106'><div class='entry-content-wrapper clearfix'>\n<section  class='av_textblock_section av-k6jjc1w6-d2a3e2b3ffad0185ecf50fe4378d1a8d '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock'  itemprop=\"text\" ><h1 class=\"custom_h1\" style=\"color: #fff;\">API<\/h1>\n<p><span style=\"color: #ffffff;\">Use TimeTrack Rest API to integrate TimeTrack with other systems.<br \/>\nHappy Coding!<\/span><\/p>\n<\/div><\/section>\n<\/div><\/div><\/main><!-- close content main element --><\/div><\/div><\/div><div id='after_section_1'  class='main_color av_default_container_wrap container_wrap fullsize'  ><div class='container av-section-cont-open' ><div class='template-page content  av-content-full alpha units'><div class='post-entry post-entry-type-page post-entry-13106'><div class='entry-content-wrapper clearfix'>\n<style type=\"text\/css\" data-created_by=\"avia_inline_auto\" id=\"style-css-av-i863ru-5470a042e8652d996c8b76929ee05881\">\n.flex_column.av-i863ru-5470a042e8652d996c8b76929ee05881{\nborder-radius:0px 0px 0px 0px;\npadding:0px 0px 0px 0px;\n}\n<\/style>\n<div  class='flex_column av-i863ru-5470a042e8652d996c8b76929ee05881 av_four_fifth  avia-builder-el-2  el_after_av_section  el_before_av_one_fifth  avia-builder-el-first  first flex_column_div av-zero-column-padding  '     ><section  class='av_textblock_section av-5dzxbao-ff2e6b2f2f3b105aee569e8ac6cf19bf '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock page_api'  itemprop=\"text\" ><h2>Timer<\/h2>\n<p>With timer endpoint you can:<\/p>\n<ul>\n<li>Read current project timer<\/li>\n<li>Start project timer<\/li>\n<li>Pause project timer<\/li>\n<li>Resume project timer<\/li>\n<li>Stop project timer<\/li>\n<li>Read current attendance timer<\/li>\n<li>Start attendance timer<\/li>\n<li>Stop attendance timer<\/li>\n<\/ul>\n<\/div><\/section><\/div><\/p>\n\n<style type=\"text\/css\" data-created_by=\"avia_inline_auto\" id=\"style-css-av-kguof6g6-97f8f79cefbcca3ddbdec2b8541426be\">\n.flex_column.av-kguof6g6-97f8f79cefbcca3ddbdec2b8541426be{\nborder-radius:0px 0px 0px 0px;\npadding:0px 0px 0px 0px;\n}\n<\/style>\n<div  class='flex_column av-kguof6g6-97f8f79cefbcca3ddbdec2b8541426be av_one_fifth  avia-builder-el-4  el_after_av_four_fifth  el_before_av_section  avia-builder-el-last  flex_column_div av-zero-column-padding  '     ><section  class='av_textblock_section av-kguoffk6-d0950a0656a04a66149fe09473bc1166 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock'  itemprop=\"text\" ><h2>Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/clients\/\">Clients<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/projects\/\">Projects<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/tasks\/\">Tasks<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/project-time-entries\/\">Project Time Entries<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/expenses\/\">Expenses<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/attendance-time-entries\/\">Attendances<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/absences\/\">Absences<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/absence-types\/\">Absence Types<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/timers\/#project-timer\">Project Timer<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/timers\/#attendance-timer\">Attendance Timer<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/timesheets\/\">User Reports<\/a><\/li>\n<\/ul>\n<\/div><\/section><\/div>\n<\/div><\/div><\/div><!-- close content main div --><\/div><\/div><div id='project-timer'  class='avia-section av-lempwmqf-bdae1d80c2ff0fb54b7656b475ef2294 main_color avia-section-default avia-no-border-styling  avia-builder-el-6  el_after_av_one_fifth  el_before_av_section  avia-bg-style-scroll container_wrap fullsize'  ><div class='container av-section-cont-open' ><div class='template-page content  av-content-full alpha units'><div class='post-entry post-entry-type-page post-entry-13106'><div class='entry-content-wrapper clearfix'>\n<div  class='flex_column av-av_one_full-7714eba142aeda1f8b5272a3c372b279 av_one_full  avia-builder-el-7  avia-builder-el-no-sibling  first flex_column_div  '     ><section  id=\"projekt-stempeluhr\"  class='av_textblock_section av-kguux7r6-1b7f23c285a26a5a5b6e88d73f819820 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock'  itemprop=\"text\" ><h2>Project timer<\/h2>\n<p>Project timer object has following params:<\/p>\n<table>\n<tbody>\n<tr>\n<th>Param<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>username<\/td>\n<td>Text<\/td>\n<td>Username<\/td>\n<\/tr>\n<tr>\n<td>startedAt<\/td>\n<td>Text<\/td>\n<td>Start Timestamp<\/td>\n<\/tr>\n<tr>\n<td>workedSeconds<\/td>\n<td>Integer<\/td>\n<td>Last saved work duration in seconds. If current timer state is Playing \/ Running, then you need to calculate work duration yourself with: Difference between <em>now<\/em> and <em>startedAt<\/em> &#8211; breakSeconds = workedSeconds<\/td>\n<\/tr>\n<tr>\n<td>breakSeconds<\/td>\n<td>Integer<\/td>\n<td>Last saved break duration in seconds. If current timer state is Paused \/ Break, then you need to calculate break duration yourself with: Difference between <em>now<\/em> and <em>startedAt<\/em> &#8211; workedSeconds = breakSeconds<\/td>\n<\/tr>\n<tr>\n<td>playing<\/td>\n<td>Boolean<\/td>\n<td>flag true or false<\/td>\n<\/tr>\n<tr>\n<td>stopped<\/td>\n<td>Boolean<\/td>\n<td>flag true or false<\/td>\n<\/tr>\n<tr>\n<td>paused<\/td>\n<td>Boolean<\/td>\n<td>flag true or false<\/td>\n<\/tr>\n<tr>\n<td>clientName<\/td>\n<td>Text<\/td>\n<td>Client name<\/td>\n<\/tr>\n<tr>\n<td>projectName<\/td>\n<td>Text<\/td>\n<td>Project name<\/td>\n<\/tr>\n<tr>\n<td>taskName<\/td>\n<td>Text<\/td>\n<td>Task name<\/td>\n<\/tr>\n<tr>\n<td>note<\/td>\n<td>Text<\/td>\n<td>Notes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Read project timer<\/h3>\n<p>IMPORTANT: For each request you have to pass the local <em>timestamp<\/em> in order to get the right duration. This date must be in same timezone like you are currently, we will use it on server to calculate workedDuration and breakDuration.<\/p>\n<blockquote>\n<p>curl &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/timers\/project_timer?username=test&amp;date=2020-10-23T16:00:00.000Z&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{}&#8217;<\/p>\n<\/blockquote>\n<h3>Start project timer<\/h3>\n<p>Required params to start project timer: date, clientName, projectName, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/timers\/project_timer\/start&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;,<br \/>\n&#8220;clientName&#8221;: &#8220;Client 006&#8221;,<br \/>\n&#8220;projectName&#8221;: &#8220;Project 006_1&#8221;,<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:00:00.000Z&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Pause project timer<\/h3>\n<p>Required params to pause project timer: date, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/timers\/project_timer\/pause&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:30:00.000Z&#8221;,<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Resume project timer<\/h3>\n<p>Required params to resume project timer: date, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/timers\/project_timer\/resume&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:30:00.000Z&#8221;,<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Stop project timer<\/h3>\n<p>Required params to stop project timer: date, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/timers\/project_timer\/stop&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:30:00.000Z&#8221;,<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<\/div><\/section><\/div>\n\n<\/div><\/div><\/div><!-- close content main div --><\/div><\/div><div id='attendance-timer'  class='avia-section av-lempvsa0-a6ab25bbcbdb20aaaf2d55365d206e5b main_color avia-section-default avia-no-border-styling  avia-builder-el-9  el_after_av_section  avia-builder-el-last  avia-bg-style-scroll container_wrap fullsize'  ><div class='container av-section-cont-open' ><div class='template-page content  av-content-full alpha units'><div class='post-entry post-entry-type-page post-entry-13106'><div class='entry-content-wrapper clearfix'>\n<div  class='flex_column av-av_one_full-7714eba142aeda1f8b5272a3c372b279 av_one_full  avia-builder-el-10  avia-builder-el-no-sibling  first flex_column_div  '     ><section  id=\"arbeitszeit-stempeluhr\"  class='av_textblock_section av-kguuy3er-2b651f2976381338fb954dd89a94358d '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock'  itemprop=\"text\" ><h2>Attendance timer<\/h2>\n<p>Attendance timer object has following params:<\/p>\n<table>\n<tbody>\n<tr>\n<th>Param<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>id<\/td>\n<td>Integer<\/td>\n<td>ID<\/td>\n<\/tr>\n<tr>\n<td>user<\/td>\n<td>Text<\/td>\n<td>Username<\/td>\n<\/tr>\n<tr>\n<td>latitudeStart<\/td>\n<td>Number<\/td>\n<td>Start GPS coordinates &#8211; Latitude<\/td>\n<\/tr>\n<tr>\n<td>longitudeStart<\/td>\n<td>Number<\/td>\n<td>Start GPS coordinates &#8211; Longitude<\/td>\n<\/tr>\n<tr>\n<td>latitudeEnd<\/td>\n<td>Number<\/td>\n<td>Stop GPS coordinates &#8211; Latitude<\/td>\n<\/tr>\n<tr>\n<td>latitudeEnd<\/td>\n<td>Number<\/td>\n<td>Stop GPS coordinates &#8211; Longitude<\/td>\n<\/tr>\n<tr>\n<td>from<\/td>\n<td>Text<\/td>\n<td>Start Timestamp<\/td>\n<\/tr>\n<tr>\n<td>to<\/td>\n<td>Text<\/td>\n<td>End Timestamp<\/td>\n<\/tr>\n<tr>\n<td>workedMinutes<\/td>\n<td>Integer<\/td>\n<td>Duration in minutes<\/td>\n<\/tr>\n<tr>\n<td>breakMinutes<\/td>\n<td>Integer<\/td>\n<td>Break duration in minutes<\/td>\n<\/tr>\n<tr>\n<td>manual<\/td>\n<td>Boolean<\/td>\n<td>Flag to show if entry was created manually or with timer. You can create Attendance entry in Web-App manually without end timestamp, this is the same as starting the attendance timer.<\/td>\n<\/tr>\n<tr>\n<td>notes<\/td>\n<td>Text<\/td>\n<td>Notes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Get attendance timer<\/h3>\n<p>Required params: date.<\/p>\n<blockquote>\n<p>curl &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/attendance_timer?username=test&amp;date=2020-10-23T16:00:00.000Z&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{}&#8217;<\/p>\n<\/blockquote>\n<h3>Start attendance timer<\/h3>\n<p>Required params: date, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/attendance_timer\/start&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;,<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:00:00.000Z&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Stop attendance timer<\/h3>\n<p>Required params: date, username<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/attendance_timer\/stop&#8221;<br \/>\n-H &#8216;Content-Type: application\/json&#8217;<br \/>\n-H &#8216;X-TimeTrack-Api-Secret: &lt;<em>API_SECRET_TOKEN&gt;<\/em>&#8216;<br \/>\n-H &#8216;X-TimeTrack-Api-Key: &lt;<em>API_KEY&gt;<\/em>&#8216;<br \/>\n-d $'{<br \/>\n&#8220;username&#8221;: &#8220;test&#8221;,<br \/>\n&#8220;date&#8221;: &#8220;2020-10-23T15:00:00.000Z&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<\/div><\/section><\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":13043,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-13106","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages\/13106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/comments?post=13106"}],"version-history":[{"count":0,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages\/13106\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages\/13043"}],"wp:attachment":[{"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/media?parent=13106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/categories?post=13106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/tags?post=13106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}