Registrazione accettazione consensi privacy

POST [baseUrl]/api/sync/v1/irs/privacy-acceptation

Descrizione

API per registrare le policy degli utenti. :::info Vengono aggiunte esclusivamente le nuove policy non ancora registrate per l’utente. I consensi esistenti non vengono sovrascritti né rimossi. :::

Parametri richiesta

Field Type Required Default Description Notes
consents Consent[] null Elenco consensi da registrare Almeno un elemento
Field Type Required Default Description Notes
fidGdpr int null ID policy GDPR Deve esistere nel catalogo attivo
accepted bool null Esito del consenso false non ammesso se la policy è obbligatoria

Esempio richiesta

sh
curl --location --request POST '[baseUrl]/api/sync/v1/irs/privacy-acceptation' \
--header 'AccessToken: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
  "consents": [
    { "fidGdpr": 10, "accepted": true },
    { "fidGdpr": 11, "accepted": false }
  ]
}'

Risposta

In caso di esito positivo.

JSON
{
    "statusCode": 200,
    "errorCode": null,
    "message": null,
    "result": {
        "totalCount": 1,
        "totalPages": 1,
        "page": 1,
        "count": 1,
        "records": null,
        "record": {
            "ok": true
        }
    },
    "debug": null
}

Gestione errori

Regola HTTP errorCode message
AccessToken assente o non valido 403 4x003 Not authorized.
Utente non trovato 400 4x102 Wrong user.
Body JSON non valido o tipi non convertibili 400 4x001 The parameters present in the body do not have a valid JSON format.
consents assente, non array o vuoto 400 4x201 Consents are required.
fidGdpr assente o null in una voce 400 4x201 fidGdpr is required for each consent.
accepted assente o null in una voce 400 4x201 accepted is required for each consent.
accepted non booleano in una voce 400 4x201 accepted must be a boolean value (true or false) for each consent.
fidGdpr non nel catalogo attivo 400 4x201 Privacy policy is not active or does not exist.
Policy obbligatoria con accepted: false 400 4x201 Mandatory privacy policy was not accepted.
fidGdpr duplicati nel payload 400 4x201 Duplicate fidGdpr values are not allowed in consents.
Tutti i consensi del payload già registrati 409 4x202 No new consents to save.
Errore persistenza 500 5x000 Internal server error

Esempio errore consensi già registrati

JSON
{
    "statusCode": 409,
    "errorCode": "4x202",
    "message": "No new consents to save.",
    "result": {
        "totalCount": 0,
        "totalPages": 0,
        "page": 0,
        "count": 0,
        "records": null,
        "record": null
    },
    "debug": null
}

Esempio errore consensi obbligatori

JSON
{
    "statusCode": 400,
    "errorCode": "4x201",
    "message": "Mandatory privacy policy 10 was not accepted.",
    "result": {
        "totalCount": 0,
        "totalPages": 0,
        "page": 0,
        "count": 0,
        "records": null,
        "record": null
    },
    "debug": null
}

Esempio errore utente non valido

JSON
{
    "statusCode": 400,
    "errorCode": "4x102",
    "message": "Wrong user.",
    "result": {
        "totalCount": 0,
        "totalPages": 0,
        "page": 0,
        "count": 0,
        "records": null,
        "record": null
    },
    "debug": null
}