User Fields

Last modified on September 8, 2023 at 5:06 pm

Resource URL

https://api.digitalchalk.com/dc/api/v5/userfields

Overview

User fields are extra data fields users can fill in when signing up or updating their own account information. Organization administrators have access to an additional set of fields on each user where private data can be recorded. This data is visible to other administrators, and can also be included in reports and data exports, and used as conditions for discounts or message displays.

User-visible data fields are called public; Administrator-only fields are called private. This visibility type is controlled at the User Field Category level, but it is included in all responses that return user fields for clarity.

You can find details of the JSON representation of userfields by referring to the Userfield Object Reference.

Use Case Examples

GET requests

OperationCallDescription
Retrieve all userfieldsGET /dc/api/v5/userfieldsRetrieve all userfield data. Parameters can be provided to limit the output based on the type of parent category.
Retrieve a specific userfieldGET /dc/api/v5/userfields/{id}Retrieve all userfield data about a specific userfield identified by {id}.

POST requests

OperationCallDescription
Create text userfieldPOST /dc/api/v5/userfieldsCreate a new userfield where the user may enter freeform text. This field can have minimum and maximum length constraints.
Create number userfieldPOST /dc/api/v5/userfieldsCreate a new userfield where the user may enter integer-type numbers. This field can have minimum and maximum value constraints.
Create decimal number userfieldPOST /dc/api/v5/userfieldsCreate a new userfield where the user may enter decimal numbers. This field can have minimum and maximum value constraints.
Create email userfieldPOST /dc/api/v5/userfieldsCreate a new userfield where the user may enter an email address. This field can have minimum and maximum length constraints, and will have extra validation to ensure the user enters a valid email address.
Create date userfieldPOST /dc/api/v5/userfieldsCreate a new userfield where the user choose a date. This field will have a date-picker user interface, and you may define minimum and maximum date constraints.
Create dropdown userfieldPOST /dc/api/v5/userfieldsCreate a new dropdown list userfield. You provide a list of options.
Create radio-buttons userfieldPOST /dc/api/v5/userfieldsCreate a new radio-buttons userfield. You provide a list of options.
Create single checkbox userfieldPOST /dc/api/v5/userfieldsCreate a new checkbox userfield.
Create checkboxes userfieldPOST /dc/api/v5/userfieldsCreate a new checkboxes userfield. You provide a list of options.
Create true/false userfieldPOST /dc/api/v5/userfieldsCreate a new true/false userfield. This is presented to the user as a dropdown list with True and False as the only two available options.
Create yes/no userfieldPOST /dc/api/v5/userfieldsCreate a new yes/no userfield. This is presented to the user as a dropdown list with Yes and No as the only two available options.
Create message userfieldPOST /dc/api/v5/userfieldsCreate a new message userfield. This can be used as an informational or instructional message for subsequent userfields.

PUT requests

Clear all userfield constraintsPUT /dc/api/v5/userfields/{id}Remove all the constraints set on a single userfield

OperationCallDescription
Move userfield to new categoryPUT /dc/api/v5/userfields/{id}You can move a userfield to a different category. Note that this allows you to move a userfield from the private set of admin-only userfield categories into the public user-modifiable categories and vice-versa.
Update userfield namePUT /dc/api/v5/userfields/{id}Modify the userfield label shown to end-users when they are filling out the information form
Toggle userfield required flagPUT /dc/api/v5/userfields/{id}Update whether the user will be required to enter a value for this field. If you mark an existing field as required, users will be prompted to enter a value for this field the next time they login.
Update userfield optionsPUT /dc/api/v5/userfields/{id}Update the set of choices a user has for option-based inputs like dropdown lists, checkboxes, or radiobuttons
Remove a userfield optionPUT /dc/api/v5/userfields/{id}Remove one of the choices a user has for option-based inputs like dropdown lists, checkboxes, or radiobuttons
Update userfield constraintsPUT /dc/api/v5/userfields/{id}Update the set of constraints on a userfield
Remove a userfield constraintPUT /dc/api/v5/userfields/{id}Remove a single constraint from a userfield
Update message userfield contentPUT /dc/api/v5/userfields/{id}Update the content of a message-type userfield

DELETE requests

OperationCallDescription
Delete a custom userfieldDELETE /dc/api/v5/userfields/{id}Delete a custom userfield from the user info form

Reference