Custom fields

Custom fields are used to record information that is not covered by the the default employee and contractor profile fields. Use the custom fields API to retrieve any employee custom fields, contractor organization custom fields, and contractor member custom fields.

See how to update custom fields in employee or contractor profiles.

Learn more about custom fields in the OnLocation Help Center.

List all custom fields

Retrieves a list of all custom fields filtered by the parameter provided: employees, contractor organizations, or contractor members.

A comma separated list of tag:value search parameters, a colon separator performs an exact match, a percent separator performs a starts-with search and greater/less than search number/date ranges.

The endpoint is limited to a maximum of 1000 records.

Each custom field contains a value pair, which consists of the field ID as the key and a string representation as the value. As custom fields contain a range of data types, the API responds with a JSON-string representation for nested data.

The fields that contain nested data are:

  • Date and Time fields if they contain a date or time range. The JSON-Format is {“start”: “value”, “end”:”value”}
  • Option fields where ‘Multiple Selection’ is activated. The value is a string representation of a JSON-Array in the format. For example, [“value1”, “value2”]
  • Person fields where ‘Multiple Selection’ is activated. The format is a string representation of a JSON-Array containing user identifiers. E.g. [1,2,3].ID can either be a contractor member identifier or an employee (staff) identifier. For example, if you add the Person field ‘Contractors from any organization’ to your employee custom fields, we’ll use the GET /customfield/element/staff endpoint to determine whether the identifier represents a contractor member or an employee.
  • If the Person field is set to ‘Single Selection’, the results will be a string representation of an identifier, eg 1
  • Checkbox fields will have a string representation of 1 if the field is selected or 0 if it is not.
Request
path Parameters
element_type
required
string <string>

Custom field element type to filter by. Options: 'staff', 'sp-org', 'sp-member'

Example: element/sp-member
query Parameters
order
string <string>

Specifies an element to order by. To order in reverse order, prepend the element with '-'.

Example: order=id
limit
integer <int32>

Limits the amount of records to return

Example: limit=10
page
integer <int32>

Specifies which page of results to return, most effective when used together with the 'limit' parameter

Responses
200

List of custom field elements

403

Returned if the account does not have access to custom fields

404

Resource not found.

get/customfield/element/{element_type}
Request samples
curl -i -X GET \
  'https://api.whosonlocation.com/v1/customfield/element/:element_type?order=string&limit=0&page=0'
Response samples
[
  • {
    }
]