List all custom fields: Migration guide

This guide details how the List all custom fields endpoint has changed (previously known as listCustomFields in v1).

💡

Key changes

  • Pagination: To improve performance, we've added pagination to this endpoint in v2. Now, you'll receive your results in pages of 1 000 custom fields. For more information, see our Pagination guide.
  • Filtering: The v2 endpoint uses the Left-Hand side (LHS) bracket notation in query parameters for filtering. For more information, see our Filtering guide.

Documentation links

Here are the links to the API reference for:

Endpoint mapping

Here's the direct correlation between the v1 and v2 endpoint URLs:

  • API v1: /api/v1/customfields
  • API v2: /api/v2/custom-fields

Behavior changes (if applicable)

The API v2 endpoint introduces pagination, resulting in pages of up to 1 000 custom fields. The response includes a Link header for fetching the next page if more results are available.
Filtering in v2 is now supported via query parameters name and type using LHS bracket notation.

Input changes

This section details the specific alterations to the input requirements between API versions.

API v1 input example

curl --location -g 'https://app.360learning.com/api/v1/customfields?company={{company}}&apiKey={{apiKey}}'

API v2 input example

curl --request GET \
     --url 'https://app.360learning.com/api/v2/custom-fields?name[eq]=Department&type[eq]=string' \
     --header '360-api-version: v2.0' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer access_token'

Main input differences

v2 introduces filtering via new query parameters.

Change typeAPI v1API v2
Modified
Path segment name
customfieldscustom-fields
Added
Query parameter
-name (Optional): Filter on name property with LHS bracket notation (e.g., name[eq]=value). Supports eq, ne, in, nin operators.
Added
Query parameter
-type (Optional): Filter on type property with LHS bracket notation (e.g., type[eq]=string). Supports eq, ne, in, nin operators and string, date types.

Output changes

This section details the specific alterations to the successful output returned between API versions.

API v1 output example

[
  {
    "_id": "610aac9922cc37084f692457",
    "name": "My New Custom Field",
    "targetCollection": "users"
  }
]

API v2 output example

[
  {
    "name": "My New Custom Field",
    "targetType": "users",
    "type": "string",
    "_id": "610aac9922cc37084f692457"
  }
]

Main output differences

Change typeAPI v1API v2
Modified
Success output
200200 with Link header: Changed to include a Link header for pagination, providing the URL to fetch the next page of results
Modified
Output property
targetCollection (Required): The object in the platform the custom field is tied to.targetType (Required): Modified name. The resource type to which the custom field is linked (users, pathSessions)
Added
Output property
-type (Required): New parameter representing the type of the custom field (string, date).