Overview

To retrieve a list of all userfield categories you have defined, you may send a GET request to the userfieldcategories URL. This request follows standard practices for paging and filter restriction conventions. If no filtering restrictions are provided, the categories retrieved will include both public and private categories. The result of this GET request will be a JSON-encoded array of userfield categories. The object definition is provided below.

JSON Object Definition

The following is a full definition of all possible properties on the JSON object representing userfields categories. For a more detailed look at this object and its properties, see the Userfield Category Object Reference.

{
  "id": "",
  "type": "", // either "public" or "private"
  "name": "",
  "orderIndex": 0,
  "createdDate": ""
}

Filtering

Filtering the result list can be accomplished by specifying value restrictions for the following properties:

Parameter name Details
name Filter based on a substring search of category names.
type Filter based on the type of userfield category. If specified, this must either be public or private.
createdDate Filter based on the date the category was created. This must be a string representation of a date. This can be a precise timestamp, an imprecise date implying a range, or a range of dates. See the Date Filtering documentation for more detail.

Examples

This sample shows a response containing three userfields categories. The first two are public categories while the final category is private. The ordering is significant — public categories are all listed before the private categories, and within each type the categories are ordered by orderIndex.

Request
GET /dc/api/v5/userfields HTTP/1.1
Host: api.digitalchalk.com
Accept: application/json

Response
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 931

{
  "results": [
    {
      "id": "a322881a721f0fe399dc6f1086a4510e",
      "type": "public",
      "name": "Office Position",
      "orderIndex": 0,
      "createdDate": ""
    },
    {
      "id": "c31984324731200022dc6f1086a4510e",
      "type": "public",
      "name": "Biographical Information",
      "orderIndex": 1,
      "createdDate": ""
    },
    {
      "id": "3d22881a721f0facd9090f18cda4510e",
      "type": "private",
      "name": "Campaign Tracking Data",
      "orderIndex": 0,
      "createdDate": ""
    }
  ]
}