Update the preferences for the current user
Update the preferences for the current user¶
To post the new preferences, or, if data already exists, to update the existing preferences object, you can use the same endpoint /preferences/my
with the POST method.
Request body
The endpoint to accept the JSON object containing Topics and the selected options ID that need to be updated. Only those, specified in the request body will be updated.
{
"widgetUuid": "string",
"language": "string",
"answers": [
{
"topicUuid": "string",
"topicAnswerUuids": [
"string"
]
}
]
}
In addition, the request should contain the proper WidgetID (widgetUuid
) and language code (language
) to properly submit a valid request.
Example:
Preference data submission request:
curl -X 'POST' \
'https://preference-api.preference-management.usercentrics.eu/public/preferences/my' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUz.......H5AC9Ru41TKgM' \
-H 'Content-Type: application/json' \
-d '{
"widgetUuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
"language": "en",
"answers": [
{
"topicUuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
"topicAnswerUuids": [
"1234abcd-22bb-33cc-44dd-12345678abcd",
"1234abcd-22bb-33cc-44dd-12345678abcd"
]
}
]
}'
For full reference to the endpoints and their parameters, responses, and error codes returned, check our Swagger documentation: https://preference-api.preference-management.usercentrics.eu/public-api-doc