Spedizione messaggi via API
Pianificazione di una notifica da servizi
Le applicazioni che prevedono la spedizione di notifiche tramite l'AppIO possono integrarsi tramite le API di backoffice esposte da AppIO.
Send a message through the service template. The service_instance parameter identifies the IO service through which the message is sent, and it's a configuration parameter provided by the service administrator. The placeholder list is also provided by the service administrator, and the API user has to provide the values. Upon receiving a call to this endpoint, GovIO builds the actual message to be sent to the IO services. In the process, the placeholders values are substituted in the message body and message subject by a template engine. A 201 response status denotes that the final message is built and scheduled by GovIO for the expedition to the IO services.
Govio Service Instance Id.
1
POST /messages HTTP/1.1
Host: localhost:10001
GovHub-Consumer-Principal: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 321
{
"taxcode": "PCRMJV76P12B782Z",
"payment": {
"amount": 62.12,
"notice_number": 300012548634478200,
"invalid_after_due_date": true,
"payee_taxcode": 10000000001
},
"email": "name@gmail.com",
"scheduled_expedition_date": "2025-07-07T00:08:33.513Z",
"due_date": "2025-07-07T00:08:33.513Z",
"placeholders": [
{
"name": "cie",
"value": "CA000000AA"
}
]
}
{
"taxcode": "PCRMJV76P12B782Z",
"payment": {
"amount": 62.12,
"notice_number": 300012548634478200,
"invalid_after_due_date": true,
"payee_taxcode": 10000000001
},
"email": "name@gmail.com",
"scheduled_expedition_date": "2025-07-07T00:08:33.513Z",
"due_date": "2025-07-07T00:08:33.513Z",
"id": 1,
"status": "accepted",
"status_detail": "text",
"appio_message_id": "text",
"creation_date": "2025-07-07T00:08:33.513Z",
"expedition_date": "2025-07-07T00:08:33.513Z",
"last_update_status": "2025-07-07T00:08:33.513Z",
"subject": "Lorem ipsum",
"markdown": "# Lorem ipsum dolor sit amet\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"sender_id": 1,
"service_instance_id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/messages/1"
},
"service_instance": {
"href": "https://govhub.it/govio/service-instances/1"
},
"sender": {
"href": "https://govhub.it/govio/users/1"
}
},
"_embedded": {
"service-instance": {
"service_id": 1,
"organization_id": 1,
"template_id": 1,
"enabled": true,
"io_service_id": "text",
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/service-instances/1"
},
"service": {
"href": "https://govhub.it/govio/services/1"
},
"organization": {
"href": "https://govhub.it/govio/organizations/1"
},
"template": {
"href": "https://govhub.it/govio/templates/1"
}
},
"_embedded": {
"service": {
"id": 1,
"service_name": "SUAP-Integrazione",
"description": "Service for customer management.",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/services/1"
},
"logo": {
"href": "https://govhub.it/govregistry/services/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/services/logo_miniature"
}
}
},
"organization": {
"id": 1,
"legal_name": "Giletti S.R.L.",
"tax_code": "01234567890",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/organizations/1"
},
"logo": {
"href": "https://govhub.it/govregistry/organizations/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/organizations/logo_miniature"
}
}
},
"template": {
"name": "Spedizione Messaggio CIE",
"description": "Segnala la scadenza della proprià C.I.E.",
"subject": "Scadenza CIE n. ${cie.uppercase}",
"message_body": "Salve, con la presente la informiamo che in data ${due_date} scadrà la Carta di Identità elettronica numero ${cie.uppercase}.",
"has_payment": true,
"has_due_date": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/templates/1"
},
"placeholders": {
"href": "https://govhub.it/govio/templates/1/placeholders"
}
}
}
}
},
"sender": {
"principal": "user-1",
"full_name": "Antonio Giscardi",
"email": "name@gmail.com",
"enabled": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govregistry/users/1"
},
"avatar": {
"href": "https://gravatar.com/avatar/md5/d2c457c9c97c9e4e2226317fe5685892/s=100&d=identicon"
}
}
}
}
}
La richiesta al servizio di pianificazione di una nuova notifica prevede il parametro idempotency_key
che consente alla piattaforma di riconoscere eventuali richieste duplicate.
Per la consultazione dei messaggi inviati sono disponibili le risorse REST di ricerca e lettura.
Read and Filter the Govio Messages.
[\s\S]*
Service identifier.
1
Organization identifier.
1
user_1
Pattern: ^[^\u0000]*$
user_1
Pattern: ^[^\u0000]*$
Filters by message state.
Sorting field.
id
Possible values: Direction Sorting field.
desc
Possible values: Max number of provided items.
offset (zero-based) of indexed results.
0
GET /messages HTTP/1.1
Host: localhost:10001
GovHub-Consumer-Principal: YOUR_API_KEY
Accept: */*
{
"page": {
"offset": 20,
"limit": 25,
"total": 32
},
"items": [
{
"taxcode": "PCRMJV76P12B782Z",
"payment": {
"amount": 62.12,
"notice_number": 300012548634478200,
"invalid_after_due_date": true,
"payee_taxcode": 10000000001
},
"email": "name@gmail.com",
"scheduled_expedition_date": "2025-07-07T00:08:33.513Z",
"due_date": "2025-07-07T00:08:33.513Z",
"id": 1,
"status": "accepted",
"status_detail": "text",
"appio_message_id": "text",
"creation_date": "2025-07-07T00:08:33.513Z",
"expedition_date": "2025-07-07T00:08:33.513Z",
"last_update_status": "2025-07-07T00:08:33.513Z",
"subject": "Lorem ipsum",
"markdown": "# Lorem ipsum dolor sit amet\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"sender_id": 1,
"service_instance_id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/messages/1"
},
"service_instance": {
"href": "https://govhub.it/govio/service-instances/1"
},
"sender": {
"href": "https://govhub.it/govio/users/1"
}
},
"_embedded": {
"service-instance": {
"service_id": 1,
"organization_id": 1,
"template_id": 1,
"enabled": true,
"io_service_id": "text",
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/service-instances/1"
},
"service": {
"href": "https://govhub.it/govio/services/1"
},
"organization": {
"href": "https://govhub.it/govio/organizations/1"
},
"template": {
"href": "https://govhub.it/govio/templates/1"
}
},
"_embedded": {
"service": {
"id": 1,
"service_name": "SUAP-Integrazione",
"description": "Service for customer management.",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/services/1"
},
"logo": {
"href": "https://govhub.it/govregistry/services/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/services/logo_miniature"
}
}
},
"organization": {
"id": 1,
"legal_name": "Giletti S.R.L.",
"tax_code": "01234567890",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/organizations/1"
},
"logo": {
"href": "https://govhub.it/govregistry/organizations/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/organizations/logo_miniature"
}
}
},
"template": {
"name": "Spedizione Messaggio CIE",
"description": "Segnala la scadenza della proprià C.I.E.",
"subject": "Scadenza CIE n. ${cie.uppercase}",
"message_body": "Salve, con la presente la informiamo che in data ${due_date} scadrà la Carta di Identità elettronica numero ${cie.uppercase}.",
"has_payment": true,
"has_due_date": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/templates/1"
},
"placeholders": {
"href": "https://govhub.it/govio/templates/1/placeholders"
}
}
}
}
},
"sender": {
"principal": "user-1",
"full_name": "Antonio Giscardi",
"email": "name@gmail.com",
"enabled": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govregistry/users/1"
},
"avatar": {
"href": "https://gravatar.com/avatar/md5/d2c457c9c97c9e4e2226317fe5685892/s=100&d=identicon"
}
}
}
}
}
]
}
Read the message with the provided id.
GovIO Message Id.
1
GET /messages/{id} HTTP/1.1
Host: localhost:10001
GovHub-Consumer-Principal: YOUR_API_KEY
Accept: */*
{
"taxcode": "PCRMJV76P12B782Z",
"payment": {
"amount": 62.12,
"notice_number": 300012548634478200,
"invalid_after_due_date": true,
"payee_taxcode": 10000000001
},
"email": "name@gmail.com",
"scheduled_expedition_date": "2025-07-07T00:08:33.513Z",
"due_date": "2025-07-07T00:08:33.513Z",
"id": 1,
"status": "accepted",
"status_detail": "text",
"appio_message_id": "text",
"creation_date": "2025-07-07T00:08:33.513Z",
"expedition_date": "2025-07-07T00:08:33.513Z",
"last_update_status": "2025-07-07T00:08:33.513Z",
"subject": "Lorem ipsum",
"markdown": "# Lorem ipsum dolor sit amet\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"sender_id": 1,
"service_instance_id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/messages/1"
},
"service_instance": {
"href": "https://govhub.it/govio/service-instances/1"
},
"sender": {
"href": "https://govhub.it/govio/users/1"
}
},
"_embedded": {
"service-instance": {
"service_id": 1,
"organization_id": 1,
"template_id": 1,
"enabled": true,
"io_service_id": "text",
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/service-instances/1"
},
"service": {
"href": "https://govhub.it/govio/services/1"
},
"organization": {
"href": "https://govhub.it/govio/organizations/1"
},
"template": {
"href": "https://govhub.it/govio/templates/1"
}
},
"_embedded": {
"service": {
"id": 1,
"service_name": "SUAP-Integrazione",
"description": "Service for customer management.",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/services/1"
},
"logo": {
"href": "https://govhub.it/govregistry/services/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/services/logo_miniature"
}
}
},
"organization": {
"id": 1,
"legal_name": "Giletti S.R.L.",
"tax_code": "01234567890",
"_links": {
"self": {
"href": "https://govhub.it/govregistry/organizations/1"
},
"logo": {
"href": "https://govhub.it/govregistry/organizations/1/logo"
},
"logo_miniature": {
"href": "https://govhub.it/govregistry/organizations/logo_miniature"
}
}
},
"template": {
"name": "Spedizione Messaggio CIE",
"description": "Segnala la scadenza della proprià C.I.E.",
"subject": "Scadenza CIE n. ${cie.uppercase}",
"message_body": "Salve, con la presente la informiamo che in data ${due_date} scadrà la Carta di Identità elettronica numero ${cie.uppercase}.",
"has_payment": true,
"has_due_date": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govio/templates/1"
},
"placeholders": {
"href": "https://govhub.it/govio/templates/1/placeholders"
}
}
}
}
},
"sender": {
"principal": "user-1",
"full_name": "Antonio Giscardi",
"email": "name@gmail.com",
"enabled": true,
"id": 1,
"_links": {
"self": {
"href": "https://govhub.it/govregistry/users/1"
},
"avatar": {
"href": "https://gravatar.com/avatar/md5/d2c457c9c97c9e4e2226317fe5685892/s=100&d=identicon"
}
}
}
}
}
Last updated