REST API: List Timesheets Deleted

Last Updated: November 07, 2016

Description

Gets deleted timesheets records.

Resource Information

HTTP Method GET
Endpoint https://rest.tsheets.com/api/v1/timesheets_deleted
Authentication Token header required. See authentication section
Request format Everything is handled through the request uri on a GET.
Response format json
Response object Timesheet

Available Filters

start_date:
required - unless modified_before, modified_since, or ids is set
String. YYYY-MM-DD formatted date. Beginning date for the report data (based off the date the timesheets were created for).
end_date:
required - unless modified_before, modified_since, or ids is set
String. YYYY-MM-DD formatted date. Ending date for the report data (based off the date the timesheets were created for).
ids:
required - unless modified_before, modified_since, or start_date and end_date are set
String. Timesheet ids. This can be a single id, an array of ids, or a comma-separated string of ids. '' by default.
modified_since:
required - unless modified_before, ids, or start_date and end_date are set
String (ISO8601 format). Only timesheets deleted since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
modified_before:
required - unless modified_since, ids, or start_date and end_date are set
String (ISO8601 format). Only timesheets deleted before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
group_ids:
optional
String. This can be a single id, an array of ids, or a comma-separated string of ids. If present, only timesheets associated with the specified group(s) will be returned. '' by default.
user_ids:
optional
String. This can be a single id, an array of ids, or a comma-separated string of ids. If present, only timesheets associated with the specified user(s) will be returned. '' by default.
username:
optional
String. If present, only timesheets associated with the specified username will be returned. Overrides user_ids and group_ids. '' by default.
jobcode_ids:
optional
String. This can be a single id, an array of ids, or a comma-separated string of ids. If present, only timesheets recorded against the specified jobcode(s) and any children will be returned. '' by default.
jobcode_type:
optional
String. 'regular', 'pto', 'paid_break', 'unpaid_break', or 'all'. Default is 'all'. Only timesheets linked to a jobcode of the given type are returned.
type:
optional
String. 'manual', 'regular', or 'both'. 'both' is the default.
order_results_by:
optional
String. 'fname', 'lname', 'username', or 'date'. 'date' is the default. All are secondarily sorted by 'date', unless 'date' is the choice, in which case 'date' is the only field the timesheets are sorted by.
order_results_reverse:
optional
Boolean. 1 or 0. If set to 1, then results are returned in reverse order by whatever they're sorted on.
supplemental_data:
optional
String. 'yes' or 'no'. Default is 'yes'. Indicates whether supplemental data should be returned.
page:
optional
Integer. Represents the page of results you'd like to retrieve. Default is 1.
per_page:
optional
Integer. Represents how many results you'd like to retrieve per request (page). Default is 50. Max is 50.

Examples

Retrieve a list of timesheets that have been deleted since August 4, 2013.

## REQUEST
## Note that instead of a plus, we're using '%2B', the url-encoded equivalent - to prevent the + getting replaced by a space.
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/timesheets_deleted?modified_since=2013-08-04T00:00:00%2B00:00"

## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
 "results": {
  "timesheets_deleted": {
   "135288460": {
    "id": 135288460,
    "user_id": 1242509,
    "jobcode_id": 18080900,
    "start": "2013-07-18T08:09:00-06:00",
    "end": "2013-07-18T14:58:00-06:00",
    "duration": 24540,
    "date": "2013-07-18",
    "tz": -6,
    "tz_str": "tsMT",
    "type": "regular",
    "location": "(Eagle, ID?)",
    "active": "0",
    "locked": 0,
    "notes": "",
    "last_modified": "2013-08-05T21:21:55+00:00"
   },
   "135288102": {
    "id": 135288102,
    "user_id": 1242515,
    "jobcode_id": 17288283,
    "start": "2013-07-22T13:05:00-06:00",
    "end": "2013-07-22T18:07:00-06:00",
    "duration": 18120,
    "date": "2013-07-22",
    "tz": -6,
    "tz_str": "tsMT",
    "type": "regular",
    "location": "(Eagle, ID?)",
    "active": "0",
    "locked": 0,
    "notes": "",
    "last_modified": "2013-08-05T21:20:11+00:00"
   }
  }
 },
 "more": false,
 "supplemental_data": {
  "jobcodes": {
   "18080900": {
    "id": 18080900,
    "parent_id": 17288279,
    "assigned_to_all": false,
    "billable": false,
    "active": true,
    "type": "regular",
    "has_children": false,
    "billable_rate": 0,
    "short_code": "",
    "name": "Customer10",
    "last_modified": "2013-07-23T22:31:28+00:00",
    "created": "2013-07-23T22:31:28+00:00"
   },
   "17288279": {
    "id": 17288279,
    "parent_id": 0,
    "assigned_to_all": false,
    "billable": false,
    "active": true,
    "type": "regular",
    "has_children": true,
    "billable_rate": 0,
    "short_code": "asm",
    "name": "Assembly Line",
    "last_modified": "2013-07-24T19:05:46+00:00",
    "created": "2013-05-28T20:18:17+00:00"
   },
   "17288283": {
    "id": 17288283,
    "parent_id": 0,
    "assigned_to_all": false,
    "billable": false,
    "active": true,
    "type": "regular",
    "has_children": false,
    "billable_rate": 0,
    "short_code": "dev",
    "name": "Development Team",
    "last_modified": "2013-07-24T19:05:53+00:00",
    "created": "2013-05-28T20:19:33+00:00"
   }
  },
  "users": {
   "1242509": {
    "id": 1242509,
    "first_name": "Courtney",
    "last_name": "Ballenger",
    "group_id": 144961,
    "active": true,
    "employee_number": 1,
    "salaried": false,
    "exempt": false,
    "username": "cballenger",
    "email": "garrett@tsheets.com",
    "payroll_id": "1",
    "hire_date": "2013-05-28",
    "term_date": "0000-00-00",
    "job_title": "",
    "gender": "",
    "last_modified": "2013-07-12T15:52:36+00:00",
    "last_active": "2013-08-05T19:38:54+00:00",
    "created": "2013-05-28T20:14:53+00:00",
    "mobile_number": ""
   },
   "1242515": {
    "id": 1242515,
    "first_name": "Alexander",
    "last_name": "Luzzana",
    "group_id": 144959,
    "active": true,
    "employee_number": 4,
    "salaried": true,
    "exempt": false,
    "username": "aluzzana",
    "email": "garrett@tsheets.com",
    "payroll_id": "4",
    "hire_date": "2012-07-01",
    "term_date": "0000-00-00",
    "job_title": "",
    "gender": "",
    "last_modified": "2013-07-12T15:52:00+00:00",
    "last_active": "2013-08-05T19:38:42+00:00",
    "created": "2013-05-28T20:23:44+00:00",
    "mobile_number": ""
   }
  }
 }
}
    

Retrieve a list of deleted timesheets that were created between August 1, 2013, and August 8, 2013.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/timesheets_deleted?start_date=2013-08-01&end_date=2013-08-08"

## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
 "results": {
  "timesheets_deleted": {
   "136022048": {
    "id": 136022048,
    "user_id": 1242325,
    "jobcode_id": 0,
    "start": "2013-08-08T08:00:00-06:00",
    "end": "2013-08-08T14:00:00-06:00",
    "duration": 21600,
    "date": "2013-08-08",
    "tz": -6,
    "tz_str": "tsMT",
    "type": "manual",
    "location": "(Eagle, ID?)",
    "active": "0",
    "locked": 0,
    "notes": "",
    "last_modified": "2013-08-09T17:30:54+00:00"
   }
  }
 },
 "more": false,
 "supplemental_data": {
  "users": {
   "1242325": {
    "id": 1242325,
    "first_name": "Garrett",
    "last_name": "Mick",
    "group_id": 144959,
    "active": true,
    "employee_number": 0,
    "salaried": true,
    "exempt": false,
    "username": "gmick",
    "email": "garrett@tsheets.com",
    "payroll_id": "0",
    "hire_date": "2013-05-28",
    "term_date": "0000-00-00",
    "job_title": "",
    "gender": "",
    "last_modified": "2013-07-12T15:51:49+00:00",
    "last_active": "2013-08-09T21:20:34+00:00",
    "created": "2013-05-28T17:49:24+00:00",
    "mobile_number": "2085550352"
   }
  }
 }
}
    

Retrieve a list of deleted timesheets with the specified ids.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/timesheets_deleted?ids=136022048"

## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
 "results": {
  "timesheets_deleted": {
   "136022048": {
    "id": 136022048,
    "user_id": 1242325,
    "jobcode_id": 0,
    "start": "2013-08-08T08:00:00-06:00",
    "end": "2013-08-08T14:00:00-06:00",
    "duration": 21600,
    "date": "2013-08-08",
    "tz": -6,
    "tz_str": "tsMT",
    "type": "manual",
    "location": "(Eagle, ID?)",
    "active": "0",
    "locked": 0,
    "notes": "",
    "last_modified": "2013-08-09T17:30:54+00:00"
   }
  }
 },
 "more": false,
 "supplemental_data": {
  "users": {
   "1242325": {
    "id": 1242325,
    "first_name": "Garrett",
    "last_name": "Mick",
    "group_id": 144959,
    "active": true,
    "employee_number": 0,
    "salaried": true,
    "exempt": false,
    "username": "gmick",
    "email": "garrett@tsheets.com",
    "payroll_id": "0",
    "hire_date": "2013-05-28",
    "term_date": "0000-00-00",
    "job_title": "",
    "gender": "",
    "last_modified": "2013-07-12T15:51:49+00:00",
    "last_active": "2013-08-09T21:20:34+00:00",
    "created": "2013-05-28T17:49:24+00:00",
    "mobile_number": "2085550352"
   }
  }
 }
}