Table of contents
CRUs, remote configurations
Description
This API allows your Organization to register with IO as a remote content provider and manage the registration over time.
Registration has as its object the configurations, that is, the set of information useful to create communication between IO and your Organization's infrastructure, according to the protocol defined in the paragraph remote-content messages.
The available operations include:
- The creation of a new remote configuration
- The modification of an existing remote configuration
- The retrieval of the defined remote configurations
- The retrieval of a particular defined configuration
“Create” API
With this API you can create a new configuration to obtain the configuration_id for use in all subsequent calls, including the creation of remote-content messages.
post
“Update” API
This API allows you to update an existing configuration, identified by the configuration_id.
put
Defined configurations retrieval API
With this API you can retrieve the configurations defined as part of the subscription indicated in the headers. Each element returned in the array rcConfigList bears the configuration's own name, description, whether there are any preconditions, and technical data (base URL and authentication information).
get
API for retrieving a configuration
With this API, using the configuration_id as a key, you can retrieve data specific to the corresponding configuration.
get
Examples
Creation of a remote configuration
In the example given, you are requested to create a new configuration related only to the production environment, for which the following are indicated:
- the base URL in the field base_url ("https://theremotecontentdomain.tld/basepath")
- the related API key with which it will authenticate on IO ("ac66427c-584b-4c81-9443-e761a226d33d" in the field**key**, value that your systems will expect in the header with the name "X-API-KEY" indicated in the field header_key_name)
1curl --location 'https://api.io.pagopa.it/api/v1/messages-sending/remote-contents/configurations' \
2--header 'Content-Type: application/json' \
3--header 'Accept: application/json' \
4--header 'Ocp-Apim-Subscription-Key: REDACTED' \
5--data '{
6 "name": "IoRemoteConfig01",
7 "description": "Configurazione contenuti remoti per app IO - Server 1",
8 "disable_lollipop_for": [],
9 "has_precondition": "NEVER",
10 "is_lollipop_enabled": false,
11 "prod_environment": {
12 "base_url": "https://theremotecontentdomain.tld/basepath",
13 "details_authentication": {
14 "header_key_name": "X-API-Key",
15 "key": "ac66427c-584b-4c81-9443-e761a226d33d",
16 "type": "API-KEY"
17 }
18 }
19}'
20The field has_precondition regulates the interpretation, by IO, of the corresponding field Has_precondition which will indicate in the creation phase of a remote-content message, according to the pattern:
| [not specified] | The preconditions when opening the message will be shown consistently with the setting of has_precondition at the individual message level |
| has_precondition: NONE | If the field has_precondition is not specified at the individual message level, this will not have preconditions to its opening; otherwise these will be displayed consistently with that value |
| has_precondition: ONCE | If the field has_precondition is not specified at the individual message level, this will have preconditions to its opening, displayed only until the message itself is read by the recipient; otherwise, the preconditions will be displayed consistently with the value indicated for that specific message. |
| has_precondition: ALWAYS | If the field has_precondition is not specified at the individual message level, the preconditions to its opening will always be displayed at every opening, consistently with the value indicated for that specific message. |
In response you will obtain, in the field "configuration_id", the identifier of the configuration that you should use in all following calls, including those for thecreation of remote-content messages which need to be served by it.
1{
2 "configuration_id": "DFE12CC534E649CD8D63BF1BAA547029"
3}
4Creating separate remote configurations for tests and production
In this second example, you can see how to create a configuration related to tests and production.
The two blocks "prod_environment" and "test_environment" are used by IO to contact your infrastructure according to the following pattern:
| you only indicate "prod_environment" | IO will contact you always using that configuration |
| you only indicate "test_environment" | IO will contact you always using that configuration |
| you only indicate both "prod_environment" and "test_environment" | IO will only contact you using the configuration indicated in "test_environment" if the message recipient’s fiscal code is included in the array "test_users", otherwise it will do so using the configuration indicated in "prod_environment" |
1curl --request POST --location 'https://api.io.pagopa.it/api/v1/messages-sending/remote-contents/configurations' \
2--header 'Content-Type: application/json' \
3--header 'Accept: application/json' \
4--header 'Ocp-Apim-Subscription-Key: REDACTED' \
5--data '{
6 "name": "IoRemoteConfig01",
7 "description": "Remote content configuration for IO app - Server 1",
8 "disable_lollipop_for": [],
9 "has_precondition": "NEVER",
10 "is_lollipop_enabled": false,
11 "test_environment": {
12 "base_url": "https://theremotecontentdomain_test.tld/basepath",
13 "details_authentication": {
14 "header_key_name": "X-API-Key",
15 "key": "78aec1e4-f625-4644-b9d9-0f3fdc8cbe60",
16 "type": "API-KEY"
17 },
18 "test_users": [
19 "HGDZDH64P28G225I",
20 "ZLMYPD56M70L669Y"
21 ]
22 },
23 "prod_environment": {
24 "base_url": "https://theremotecontentdomain.tld/basepath",
25 "details_authentication": {
26 "header_key_name": "X-API-Key",
27 "key": "ac66427c-584b-4c81-9443-e761a226d33d",
28 "type": "API-KEY"
29 }
30 }
31}'
32In response you will obtain, in the field "configuration_id", the identifier of the configuration that you should use in all following calls, including those for thecreation of remote-content messages which need to be served by it.
1{
2 "configuration_id": "DFE12CC534E649CD8D63BF1BAA547029"
3}
4Retrieval of defined configurations
In this example we show you how to retrieve the complete list of configurations you have defined as part of your subscription:
1curl --location 'https://api.io.pagopa.it/api/v1/messages-sending/remote-contents/configurations' \
2--header 'Accept: application/json' \
3--header 'Ocp-Apim-Subscription-Key: REDACTED'
41{
2 "rcConfigList": [
3 {
4 "configuration_id": "DFE12CC534E649CD8D63BF1BAA547029",
5 "name": "IoRemoteConfig01",
6 "description": "Remote content configuration for IO app - Server 1",
7 "disable_lollipop_for": [],
8 "has_precondition": "NEVER",
9 "is_lollipop_enabled": false,
10 "test_environment": {
11 "base_url": "https://theremotecontentdomain_test.tld/basepath",
12 "details_authentication": {
13 "header_key_name": "X-API-Key",
14 "key": "78aec1e4-f625-4644-b9d9-0f3fdc8cbe60",
15 "type": "API-KEY"
16 },
17 "test_users": [
18 "HGDZDH64P28G225I",
19 "ZLMYPD56M70L669Y"
20 ]
21 },
22 "prod_environment": {
23 "base_url": "https://theremotecontentdomain.tld/basepath",
24 "details_authentication": {
25 "header_key_name": "X-API-Key",
26 "key": "ac66427c-584b-4c81-9443-e761a226d33d",
27 "type": "API-KEY"
28 }
29 }
30 }
31 ]
32}
33Retrieving a specific configuration
In this example you can see how, being in possession of a configuration_id, you can retrieve all the information about a previously defined configuration:
1curl --location 'https://api.io.pagopa.it/api/v1/messages-sending/remote-contents/configurations/DFE12CC534E649CD8D63BF1BAA547029' \
2--header 'Accept: application/json' \
3--header 'Ocp-Apim-Subscription-Key: REDACTED'
41{
2 "configuration_id": "DFE12CC534E649CD8D63BF1BAA547029",
3 "description": "Remote content configuration for IO app - Server 1",
4 "disable_lollipop_for": [],
5 "has_precondition": "NEVER",
6 "is_lollipop_enabled": false,
7 "name": "IoRemoteConfig01",
8 "prod_environment": {
9 "base_url": "https://theremotecontentdomain.tld/basepath",
10 "details_authentication": {
11 "header_key_name": "X-API-Key",
12 "key": "ac66427c-584b-4c81-9443-e761a226d33d",
13 "type": "API-KEY"
14 }
15 }
16}
17Modification of an existing configuration
In this example we show you how you can update the data of a previously defined configuration, specifically here you edit its description:
1curl --location --request PUT 'https://api.io.pagopa.it/api/v1/messages-sending/remote-contents/configurations/DFE12CC534E649CD8D63BF1BAA547029' \
2--header 'Content-Type: application/json' \
3--header 'Accept: application/json' \
4--header 'Ocp-Apim-Subscription-Key: REDACTED' \
5--data '{
6 "configuration_id": "DFE12CC534E649CD8D63BF1BAA547029",
7 "description": "***NUOVA*** configurazione contenuti remoti per app IO - Server 1",
8 "disable_lollipop_for": [],
9 "has_precondition": "NEVER",
10 "is_lollipop_enabled": false,
11 "name": "IoRemoteConfig01",
12 "prod_environment": {
13 "base_url": "https://theremotecontentdomain.tld/basepath",
14 "details_authentication": {
15 "header_key_name": "X-API-Key",
16 "key": "ac66427c-584b-4c81-9443-e761a226d33d",
17 "type": "API-KEY"
18 }
19 }
20}'
211204 No content.
2Useful resources
On this page
Haven't completed onboarding yet and need help?
Write an email describing your problem or question to the address areariservata@assistenza.pagopa.it.
Tell us what you think
To report problems or give feedback, leave a comment in the GitHub space of the IO app