Skip to content

updateUserPreferences ​

Updates one of more user preferences (APP-Level or ASSET-Level) given an authenticated user by deleting all exisitng preference values and then re-inseritng them as new records. This is more of a "replace" method of update. NOTE: You must pass "all" the values that you want set, not partial otherwise the exisitng values will be deleted.

Request ​

http
PUT /rest/user/preferences/{uPrefId}

Headers ​

HeaderRequiredDescription
x-nextinteract-authtokenYesAuth token returned from loginUser

Parameters ​

ParameterTypeRequiredDescription
uPrefIdNumberYesPath variable. The unique id of the user preferences to update. This is the id created during createXYZ API calls.
valuesArray of Strings (max 100 length)YesThe values to be set for the given asset-level user preference. At least one required.

SAMPLE REQUEST: http://localhost:8080/nextinteract-webapp/rest/user/preferences/29

SAMPLE BODY:

json
{
  "values": [
    "1,2"
  ]
}

Response ​

200 OK ​

Returns the newly created user preferences with uPrefValueId that can be used for updates/deletes.

RESPONSE:

json
{
    "uPrefId": 29,
    "type": "ALP",
    "key": "ALP-FAV",
    "values": [
        {
            "uPrefValueId": 44,
            "value": "1",
            "lastModified": 1567662973000
        },
        {
            "uPrefValueId": 22,
            "value": "2",
            "lastModified": 1567662973000
        }
    ]
}

Errors ​

ExceptionDescription
WSInvalidAuthTokenExceptionSee Error Definitions
WSCacheServiceExceptionSee Error Definitions
WSInvalidParameterExceptionSee Error Definitions
WSRecordNotFoundExceptionSee Error Definitions
WSUserPreferenceServiceExceptionSee Error Definitions