{"id":13064,"date":"2020-10-30T09:47:42","date_gmt":"2020-10-30T08:47:42","guid":{"rendered":"https:\/\/wpstaging.timetrackapp.com\/api\/api-absences\/"},"modified":"2023-03-01T13:01:30","modified_gmt":"2023-03-01T12:01:30","slug":"absences","status":"publish","type":"page","link":"https:\/\/wpstaging.timetrackapp.com\/en\/api\/absences\/","title":{"rendered":"API &#8211; Absences"},"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-13064'><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-13064'><div class='entry-content-wrapper clearfix'>\n<style type=\"text\/css\" data-created_by=\"avia_inline_auto\" id=\"style-css-av-l634aa-83697dd996cd003a7b28d2743c119436\">\n.flex_column.av-l634aa-83697dd996cd003a7b28d2743c119436{\nborder-radius:0px 0px 0px 0px;\npadding:0px 0px 0px 0px;\n}\n<\/style>\n<div  class='flex_column av-l634aa-83697dd996cd003a7b28d2743c119436 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>Absences<\/h2>\n<p>With this endpoint you can:<\/p>\n<ul>\n<li>Get all absences without filter<\/li>\n<li>Get all absences with filter<\/li>\n<li>Read Absence<\/li>\n<li>Create Absence<\/li>\n<li>Update Absence<\/li>\n<li>Delete Absence<\/li>\n<\/ul>\n<p>Absence 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 of user<\/td>\n<\/tr>\n<tr>\n<td>from<\/td>\n<td>Text<\/td>\n<td>Start date &#8211; Format: YYYY-MM-DD<\/td>\n<\/tr>\n<tr>\n<td>to<\/td>\n<td>Text<\/td>\n<td>End date- Format: YYYY-MM-DD<\/td>\n<\/tr>\n<tr>\n<td>status<\/td>\n<td>Integer<\/td>\n<td>Absence state: 0 &#8211; new and waiting for approval, 1 &#8211; approved, 2 &#8211; disapproved<\/td>\n<\/tr>\n<tr>\n<td>absenceType<\/td>\n<td>Integer<\/td>\n<td>ID of absence type<\/td>\n<\/tr>\n<tr>\n<td>absenceTypeName<\/td>\n<td>Text<\/td>\n<td>Short name \/ short code of absence type<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Get all absences without filter<\/h3>\n<blockquote>\n<p>curl &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences\/&#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>Get all absences with filter<\/h3>\n<p>Following params can be used for search \/ filter:<\/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>user<\/td>\n<td>Text<\/td>\n<td>Username of user<\/td>\n<\/tr>\n<tr>\n<td>from<\/td>\n<td>Text<\/td>\n<td>Date &#8211; Format: YYYY-MM-DD<\/td>\n<\/tr>\n<tr>\n<td>to<\/td>\n<td>Text<\/td>\n<td>Date &#8211; Format: YYYY-MM-DD<\/td>\n<\/tr>\n<tr>\n<td>absenceType<\/td>\n<td>Integer<\/td>\n<td>ID of absence type<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In this example we get all absences of user &#8220;tester&#8221; between 2020-10-01 and 2020-10-31<\/p>\n<blockquote>\n<p>curl &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences?username= tester&amp;from=2020-10-01&amp;to=2020-10-31&#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>Read Absence<\/h3>\n<p><strong>Required params<\/strong>: ID<\/p>\n<blockquote>\n<p>curl &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences\/1&#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>Create Absence<\/h3>\n<p>You can use all params of Absence object.<\/p>\n<p><strong>Required params<\/strong>: username, from, to, absenceType<\/p>\n<blockquote>\n<p>curl -X &#8220;POST&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences&#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;tester&#8221;,<br \/>\n&#8220;absenceType&#8221;: 1,<br \/>\n&#8220;to&#8221;: &#8220;2020-10-28&#8221;,<br \/>\n&#8220;from&#8221;: &#8220;2020-10-26&#8221;<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Upadte Absence<\/h3>\n<p>You can update following params: status.<\/p>\n<blockquote>\n<p>curl -X &#8220;PUT&#8221; &#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences\/1&#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;status&#8221;: 1<br \/>\n}&#8217;<\/p>\n<\/blockquote>\n<h3>Delete Absence<\/h3>\n<blockquote>\n<p>curl -X &#8220;DELETE&#8221;\u00a0&#8220;https:\/\/testaccount.timetrackenterprise.com\/api\/v2\/ext\/absences\/1&#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<\/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  avia-builder-el-last  flex_column_div av-zero-column-padding  '     ><section  class='av_textblock_section av-kguoffk6-c7fc6bdf8ba12cf48c24e35eca104db4 '   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\/#projekt-stempeluhr\">Project Timer<\/a><\/li>\n<li><a href=\"https:\/\/wpstaging.timetrackapp.com\/en\/api\/timers\/#arbeitszeit-stempeluhr\">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","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-13064","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages\/13064","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=13064"}],"version-history":[{"count":0,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/pages\/13064\/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=13064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/categories?post=13064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpstaging.timetrackapp.com\/en\/wp-json\/wp\/v2\/tags?post=13064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}