Submit a Message passing the user fiscal_code in the request body

Descrizione

API per l’invio di messaggi verso un cittadino identificato tramite Codice Fiscale. Prima di inviare un messaggio è importante verificare che il cittadino sia iscritto a IO e che il servizio possa inviare comunicazioni al cittadino stesso.

Submit a Message passing the user fiscal_code in the request body

post

Submits a message to a user with STANDARD or ADVANCED features based on feature_level_type value. On error, the reason is returned in the response payload. In order to call submitMessageforUser, before sending any message, the sender MUST call getProfile and check that the profile exists (for the specified fiscal code) and that the sender_allowed field of the user's profile it set to true.

Authorizations
Body
time_to_liveinteger · min: 3600 · max: 604800Optional

This parameter specifies for how long (in seconds) the system will try to deliver the message to the channels configured by the user.

Default: 3600Example: 3600
contentall ofRequired
fiscal_codestring · FiscalCodeOptional

User's fiscal code.

Example: SPNDNL80R13C555X
feature_level_typestringOptionalDefault: STANDARDExample: STANDARD
Responses
201
Message created.
application/json
post
POST /api/v1/messages HTTP/1.1
Host: api.io.pagopa.it
Ocp-Apim-Subscription-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1043

{
  "time_to_live": 3600,
  "content": {
    "subject": "Welcome new user !",
    "markdown": "# This is a markdown header\n\nto show how easily markdown can be converted to **HTML**\n\nRemember: this has to be a long text.",
    "require_secure_channels": true,
    "payment_data": {
      "amount": 1,
      "notice_number": "text",
      "invalid_after_due_date": false,
      "payee": {
        "fiscal_code": "12345678901"
      }
    },
    "prescription_data": {
      "nre": "text",
      "iup": "text",
      "prescriber_fiscal_code": "TCNZRO80R13C555Y"
    },
    "legal_data": {
      "sender_mail_from": "text",
      "has_attachment": false,
      "message_unique_id": "text",
      "original_message_url": "text",
      "pec_server_service_id": "text"
    },
    "eu_covid_cert": {
      "auth_code": "text"
    },
    "third_party_data": {
      "id": "text",
      "original_sender": "text",
      "original_receipt_date": "2018-10-13T00:00:00.000Z",
      "has_attachments": false,
      "has_remote_content": false,
      "has_precondition": "text",
      "summary": "text",
      "configuration_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
    },
    "due_date": "2018-10-13T00:00:00.000Z"
  },
  "default_addresses": {
    "email": "foobar@example.com"
  },
  "fiscal_code": "SPNDNL80R13C555X",
  "feature_level_type": "STANDARD"
}
{
  "id": "text"
}

time_to_live

Descrizione

Tempo espresso in secondi che specifica il tempo di retry di delivery del messaggio

Obbligatorio

No

Default

3600

Tipo

Intero

Esempio

3600

feature_level_type

Descrizione

Indica se il messaggio è inviato nell’ambito di una sottoscrizione Premium, o se è da considerarsi un messaggio standard

Obbligatorio

No

Default

STANDARD

Tipo

Stringa enumerata

Valori Accettati

  • STANDARD -> il messaggio è da considerarsi un normale messaggio IO

  • ADVANCED -> al messaggio sono correlate informazioni aggiuntive avanzate. È possibile specificare questo valore solo se si è titolari di una sottoscrizione Premium.

Esempio

ADVANCED

content *

subject *

Descrizione

Titolo del messaggio, la cui lunghezza deve essere compresa tra 10 e 120 caratteri

Obbligatorio

Tipo

Stringa

Esempio

Rinnova la tua carta d'identità

markdown *

Descrizione

Testo del messaggio in formato markdown la cui lunghezza deve essere compresa tra 80 e 10000 caratteri

Obbligatorio

Tipo

Stringa

Esempio

This is my first message to the IO app. Use body markdown format with min 80 characters.

Per testare la sintassi in markdown, puoi utilizzare un servizio online come Stackedit.

due_date

Descrizione

Permette di associare al messaggio un promemoria. Il formato data deve essere ISO-8601 e fuso orario UTC

Obbligatorio

No

Tipo

Stringa

Esempio

2018-10-13T00:00:00.000Z

payment_data

Per l’invio degli avvisi di pagamento è necessario richiedere specifica l’abilitazione.

amount *

Descrizione

Importo in centesimi di euro dell’avviso di pagamento emesso su piattaforma pagoPA

Obbligatorio

Sì, per pagamenti pagoPA

Tipo

Intero

Esempio

100

notice_number *

Descrizione

Codice avviso di un avviso di pagamento emesso su piattaforma pagoPA

Obbligatorio

Sì, per i pagamenti pagoPA

Tipo

Stringa

Esempio

301011100007347557

invalid_after_due_date

Descrizione

In app visualizza il pagamento come scaduto se la data attuale è successiva a due_date

Obbligatorio

No

Default

false

Tipo

Booleano

Esempio

false

payee

Questa funzionalità è in sperimentazione interna.

third_party_data

id *

Descrizione

identificativo third party univoco, generato dall'ente, necessario per poter aggregare il messaggio coi suoi allegati

Obbligatorio

Tipo

Stringa

Esempio

false

has_attachments

Descrizione

Indica la presenza di eventuali allegati relativi al messaggio.

Obbligatorio

No

Default

false

Tipo

Booleano

Esempio

false

🚧 Campi riservati per utilizzi futuri

original_sender

original_receipt_date

summary

prescription_data

Questa funzionalità è in sperimentazione interna.

eu_covid_cert

Questa funzionalità è riservata ai soggetti autorizzati.

Questa funzionalità è in sperimentazione interna.

Esempi

### REQUEST
curl --location --request POST 'https://api.io.pagopa.it/api/v1/messages' \
--header 'Content-Type: application/json' \
--header 'Ocp-Apim-Subscription-Key: __YOUR_API_KEY__' \
--data-raw '{
"content": {
"subject": "Welcome new user !",
"markdown": "# This is a markdown header\n\nto show how easily markdown can be converted to **HTML**\n\nRemember: this has to be a long text."
},
“feature_type”: “STANDARD”,
"fiscal_code": "AAAAAA00A00A000A"
}'
### RESPONSE
{
"id": "01EM6X4JB9VSZTQ8H16KMQFCEJ"
}

Risorse utili

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

Last updated