Retrieve consent history log

Prev Next

History log contains records of all changes applied to a specific preference data object. Every time a user opts in or out from a certain option under the widget, a new record is added into the history log to track this action. For more details about accessing the history log via the Admin UI, please refer to the dedicated section of this documentation.

Using our public API you can also obtain the whole history log by calling a designated endpoint GET /preferences/history.

Parameters:

The endpoint uses following parameters:

  • userId (required): The ID of the user who submitted preference data
  • widgetUuid (required): The ID of the widget under which the preference were submitted under

Example:

curl -X 'GET' \
  'https://preference-api.preference-management.usercentrics.eu/public/preferences/history?widgetUuid=1234abcd-22bb-33cc-44dd-12345678abcd' \
  -H 'accept: application/json' \
  -H 'x-user-id: user@company.com' \
  -H 'X-API-KEY: 7b931a0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa0d1'

The response will include a list of events that affected the preference data object as set of objects in a JSON format, each having the following structure:

  • preferenceUuid - ID of the preference data object
  • author - the author of the change: it can be either the end user or owner of the API Key who performed the change using the API Key-protected API endpoint
  • changeType - the type of event: Added | Removed | Removed_All | Expired
  • submittedAt - date of the event
  • widgetUuid - widget ID this preference object belongs to
  • topicUuid - ID of the topic that has been updated
  • language - the translation variant that was used when the change was initiated
  • topicTitleEn - the title of the topic in English at the time when the change was initiated (what the user actually saw)
  • topicTitleTranslated - the title of the topic in the translated variant at the time when the change was initiated (what the user actually saw)
  • answers - object describing details of the option that was affected
    • uuid - ID of the option affected
    • en - the title of the option in English at the time when the change was initiated (what the user actually saw)
    • translated - the title of the option in English at the time when the change was initiated (what the user actually saw)

Example:
In this example, the change was made to the German translation of the widget, adding Wöchentlich (EN: Weekly) as an option to the Topic with the title Frequenz (EN: Frequency)

[
   {
    "preferenceUuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
    "submittedAt": "2024-01-01T00:00:00.001Z",
    "widgetUuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
    "topicUuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
    "language": "de",
    "topicTitleEn": "Frequency",
    "topicTitleTranslated": "Frequenz",
    "answers": [
      {
        "uuid": "1234abcd-22bb-33cc-44dd-12345678abcd",
        "en": "Weekly",
        "translated": "Wöchentlich"
      }
    ],
    "author": "user@company.com",
    "changeType": "Added"
  },
  {
  ........
  }
]