Overview

Retrieve a list of the userfield values assigned to a user. The response will consist of a single JSON object with key-value pairs where the key is the userfield id, and the value is the value assigned to that field for the given user.

Examples

Retrieve with no userfield values set

This sample shows the result of a userfield values request where no values have been assigned for the given user. Since the user exists, this will not result in a 404 because there is a userfield values resource at the given URL; it is simply empty. Thus the response contains a JSON object with zero properties.

Request
GET /dc/api/v5/users/322881a721f0fe399dc6f1086a4510e/userfieldvalues HTTP/1.1
Host: org.digitalchalk.com
Accept: application/json

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

{
}

Retrieve string-type userfield values

In this example, userfield values have been assigned to two userfields for the given user. One field is a simple string field, the other is an email field. Both are represented as simple JSON strings.

Request
GET /dc/api/v5/users/322881a721f0fe399dc6f1086a4510e/userfieldvalues HTTP/1.1
Host: org.digitalchalk.com
Accept: application/json

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

{
  "afc72b34f1f0fe399dc6f1086a4510e" : "Some simple string value",
  "5981d34db33ffe399dc6f1072901aa2" : "an_email_address@organization.com"
}

Retrieve number-type userfield values

In this example, userfield values have been assigned to two userfields for the given user. One field is an integer value, the other is a float. Both are represented as JSON number values.

Request
GET /dc/api/v5/users/322881a721f0fe399dc6f1086a4510e/userfieldvalues HTTP/1.1
Host: org.digitalchalk.com
Accept: application/json

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

{
  "afc72b34f1f0fe399dc6f1086a4510e" : 42,
  "5981d34db33ffe399dc6f1072901aa2" : 3.1415 
}

Retrieve checkboxes-type userfield values

In this example, a value has been assigned to a checkboxes userfield. Checkboxes allow the user to select multiple values for a single field, so the value on the response object will consist of an array of strings. Checkboxes values will always be in an array even if only one value has been selected.

Request
GET /dc/api/v5/users/322881a721f0fe399dc6f1086a4510e/userfieldvalues HTTP/1.1
Host: org.digitalchalk.com
Accept: application/json

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

{
  "afc72b34f1f0fe399dc6f1086a4510e" : [ "Red", "Green", "Blue" ]
}

References