Documentation

/users/{userId}/customfields/{customFieldId} [PATCH]

ThoughtFarmer REST API Method: /users/{userId}/customfields/{customFieldId} [PATCH]

Updates a custom field for a user.
 
URL:
http://yourserver.com/api/users/{userId}/customfields/{customFieldId}

Response Formats:
JSON, XML

HTTP Method(s):
PATCH
 
Requires Authentication:
true, user making call must pass a valid token parameter

Parameters:

 Parameter Type Description
userId int Required. The user id of the user to retrieve
customFieldId int Required. The id of the custom field to update
value string Required. The value to update the custom field to
token string Required. A valid token authentication parameter
Response Status Codes:
200 - Success
400 - Any of: the value doesn't match an option in a dropdown custom field; value is too long; value is empty for a tag custom field; tag creation is disabled; custom field is not editable

401 - Token parameter is invalid
403 - You do not have permission to update this user or you are trying to update a private custom field that does not belong to you
404 - User or custom field not found

Example request
PATCH http://yourserver.com/api/users/{userId}/customfields/{customFieldId}
  Content-Type: application/json
{
    "value": "Cake"
}
e.g. https://yourserver.com/api/users/1234/customfields/9876
{
    "customFieldId": 15,
    "name": "CakeorPie",
    "type": 4,
    "editable": true,
    "value": "Cake",
    "label": [
        {
            "key": "en",
            "value": "Cake or Pie?"
        }
    ]
}