Appearance
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 ​
| Header | Required | Description |
|---|---|---|
x-nextinteract-authtoken | Yes | Auth token returned from loginUser |
Parameters ​
| Parameter | Type | Required | Description |
|---|---|---|---|
uPrefId | Number | Yes | Path variable. The unique id of the user preferences to update. This is the id created during createXYZ API calls. |
values | Array of Strings (max 100 length) | Yes | The 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 ​
| Exception | Description |
|---|---|
WSInvalidAuthTokenException | See Error Definitions |
WSCacheServiceException | See Error Definitions |
WSInvalidParameterException | See Error Definitions |
WSRecordNotFoundException | See Error Definitions |
WSUserPreferenceServiceException | See Error Definitions |