REST API: List Custom Fields

Last Updated: November 07, 2016

Description

Retrieves a list of all customfields associated with your company, with optional filters to narrow down the results.

Resource Information

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

Available Filters

ids:
optional
Integer. Comma separated list of one or more customfield ids you'd like to filter on. Only customfields with an id set to one of these values will be returned. If omitted, all customfields matching other specified filters are returned.
active:
optional
String. 'yes', 'no', or 'both'. Default is 'yes'.
applies_to:
optional
String. timesheet, user, jobcode, or all. Default is timesheet.
value_type:
optional
String. managed-list, free-form, or both. Default is both.
modified_before:
optional
String (ISO8601 format). Only customfields modified before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
modified_since:
optional
String (ISO8601 format). Only customfields modified since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).
supplemental_data:
optional
String. 'yes' or 'no'. Default is 'yes'. Indicates whether supplemental data should be returned.
per_page:
optional
Integer. Represents how many results you'd like to retrieve per request (page). Default is 50. Max is 50.
page:
optional
Integer. Represents the page of results you'd like to retrieve. Default is 1.

Examples

Retrieve a list of all customfields.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/customfields"

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

{
 "results": {
  "customfields": {
   "19142": {
    "id": 19142,
    "required": true,
    "type": "timesheet",
    "ui_preference": "managed-list",
    "short_code": "cf1",
    "regex_filter": "",
    "name": "Custom Field 1",
    "last_modified": "2013-07-23T23:09:14+00:00",
    "created": "2013-07-23T23:09:14+00:00"
   },
   "19144": {
    "id": 19144,
    "required": true,
    "type": "timesheet",
    "ui_preference": "managed-list",
    "short_code": "cf2",
    "regex_filter": "",
    "name": "Custom Field 2",
    "last_modified": "2013-07-23T23:09:32+00:00",
    "created": "2013-07-23T23:09:32+00:00"
   }
  }
 },
 "more": false
}
    

Retrieve a list of customfields with id 19144.

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

## RESPONSE
## (response would have the same layout as the above example)
    

Retrieve a list of customfields that have been modified since Jan 1, 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/customfields?modified_since=2013-01-01T00:00:00%2B00:00"

## RESPONSE
## (response would have the same layout as the above example)