⚠️Get a User Profile

Attenzione: la seguente API sarà a breve deprecata, pertanto se ne sconsiglia l’uso. Utilizzare Get a User Profile using POST

Descrizione

API che permette di controllare che il cittadino identificato tramite codice fiscale sia iscritto ad IO e che il servizio possa inviare comunicazioni al cittadino stesso.

La risposta è ritenuta positiva se entrambe le condizioni sono verificate:

  1. lo status code della risposta è 200

  2. nel body di risposta il campo sender_allowed=true

Get a User Profile

Returns the preferences for the user identified by the provided fiscal code. The field sender_allowed is set fo false in case the service which is calling the API has been disabled by the user.

GEThttps://api.io.pagopa.it/api/v1/profiles/{fiscal_code}
Authorization
Path parameters
fiscal_code*string

The fiscal code of the user, all upper case.

Response

Found.

Body
sender_allowed*boolean

True in case the service that made the request can send messages to the user identified by this profile (false otherwise).

preferred_languagesarray of string

Indicates the User's preferred written or spoken languages in order of preference. Generally used for selecting a localized User interface. Valid values are concatenation of the ISO 639-1 two letter language code, an underscore, and the ISO 3166-1 2 letter country code; e.g., 'en_US' specifies the language English and country US.

Request
const response = await fetch('https://api.io.pagopa.it/api/v1/profiles/{fiscal_code}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "sender_allowed": false,
  "preferred_languages": [
    "it_IT"
  ]
}

Esempi

### REQUEST
curl --location --request GET 'https://api.io.pagopa.it/api/v1/profiles/AAAAAA00A00A000A' \
--header 'Ocp-Apim-Subscription-Key: __YOUR_API_KEY__'
### RESPONSE
{
"sender_allowed": true
}

Risorse utili

https://developer.io.italia.it/openapi.html#operation/getProfile

Last updated