Overview

To update the message property of a userfield, you can send an HTTP PUT request to the userfield URL with a JSON object containing a message property with the updated value. This property controls the text displayed to the end-user by a message-type userfield.

Note that you are not limited to updating one property at a time; all fields that are valid for a particular userfield type may be updated in a single request. All fields not specified will retain their value. See the Userfield Object Reference for a list of all the object’s fields.

Example

This example shows the request-response sequence when updating its size property.

Request
PUT /dc/api/v5/userfields/8da97a97a92efd18dcbc12876a4510e HTTP/1.1
Host: org.digitalchalk.com
Content-type: application/json
Accept: application/json

{
	"message": "Please provide the following information to help us better tailor our future course offerings."
}
Response
HTTP/1.1 204 No Content

Failure Cases

Below is a list of the most common failure scenarios your code should be prepared to handle. This list is not exhaustive.

Validation error

After the userfield property changes have been applied it will be re-validated. If a validation error occurs, the server will issue a 400 Bad Request response with a JSON object in the response body. The object contains a message attribute describing the eror.

Request
POST /dc/api/v5/userfields HTTP/1.1
Host: org.digitalchalk.com
Content-type: application/json
Accept: application/json

{
	"message": null
}
Response
HTTP/1.1 400 Bad Request
Content-type: application/json
Content-length: 210

{
	message: "message is required"
}

References