Table of contents
Add attachments
What are attachments
They are PDF documents shown at the bottom of the message content. These attachments are retrieved by the systems of the sending institution each time the user accesses the resource in the IO app.
How does it work?
Step 1- Define a remote configuration
To permit IO to know your systems dedicated to attachments, you must define at least one Remote Configuration, which you will indicate later when sending each message.
Step 2- Show the retrieval endpoints for the attachments
To permit IO to retrieve the content of a message and its attachments, **you must make a **REST web service available in compliance with the relative OpenAPI.
For more information, read OpenAPI recovery endpoint of remote content.
To include the attachments in a message, in addition to the steps indicated in ✉️ Send a message, you must follow these steps:
Step 3- Include the block Third_party_data
Include the Third_party_data block, specifying the reference Remote configuration and the remote correlation id, which IO returns to you when it asks you for the metadata and, subsequently, the bytes of the attachments to the particular message you are sending.
Step 4- Specify the value TRUE in the field Has_attachments
Step 5- Specify the value ADVANCED in the field Feature_level_type
Specify the value ADVANCED in the field Feature_level_type present in the request.
Examples
Example of a call for sending a message with attachments:
1curl --location --request POST 'https://api.io.pagopa.it/api/v1/messages' \
2--header 'Ocp-Apim-Subscription-Key: <YOUR_API_KEY>' \
3--header 'Content-Type: application/json' \
4--data-raw '{
5 "content": {
6 "subject": "Message with attachments",
7 "markdown": "# Title\n\nMessage text: contains **attachments**!",
8 "third_party_data": {
9 "id": "c7832d5f-5946-48a3-ba9d-2d1e3aa3f7e5",
10 "configuration_id": "0e9852ccb8a04128bd637c807b9d80d3",
11 "has_attachments": true
12 }
13 },
14 "feature_level_type": "ADVANCED",
15 "fiscal_code": "<validFiscalCode>",
16}'
17Example of a positive response:
1{
2 "id": "01BX9NSMKVXXS5PSP2FATZMYYY"
3}
4Haven'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