The easiest and most secure solution for sending your Massive REMs
Manage and automate the sending of large quantities of Certified Electronic Mail messages via API
All the knowledge you need
Here you can find some advice to consider to approach this API. If you prefer, we provide code samples, OAS3 documentation, the ability to try the API live via the Swagger UI or import the entire collection into Postman. We also offer a Sandbox environment where you can experiment with all kinds of requests completely free of charge.
Get the token in the appropriate section before you start.
- Oas file url https://console.openapi.com/oas/en/pecmassiva.openapi.json
- Fork or import with Postman
- Production domain ws.pecmassiva.com
- Sandbox domain test.ws.pecmassiva.com
- Production Scopes 6
-
Sandbox Scopes 6
- GET test.ws.pecmassiva.com/send
- GET test.ws.pecmassiva.com/inbox
- DELETE test.ws.pecmassiva.com/inbox
- GET test.ws.pecmassiva.com/quota
- POST test.ws.pecmassiva.com/send
- DELETE test.ws.pecmassiva.com/send
PEC Massiva 1.0 (1.0.0)
This service offers rest calls to send massive pecs and check the status of the delivery verification and receipt verification emails
List of all the emails related to a given sending
Returns the status of the receipt and delivery verification emails relating to the sending with the code returned at the time of sending the PEC
Authorizations:
path Parameters
code required | string Example: 2020082610003492 Code returned at the time of sending the PEC |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Response Schema: application/json
Array of objects (ResponseStatus) | |
success | boolean |
message | string |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/send/%7Bcode%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 401
- 404
- "data": [
- {
- "data": "Wed, 26 Aug 2020 10:00:35 +0200",
- "object": "ACCETTAZIONE: Invio di prova pec massiva 2020082610003492",
- "message": ""
- {
- "data": "Wed, 26 Aug 2020 10:00:35 +0200",
- "object": "POSTA CERTIFICATA: Invio di prova pec massiva 2020082610003492",
- "message": "Salve, questa email � una prova di invio, che prevede un corpo in html"
- {
- "data": "Wed, 26 Aug 2020 10:00:36 +0200",
- "object": "CONSEGNA: Invio di prova pec massiva 2020082610003492",
- "message": "Salve, questa email � una prova di invio, che prevede un corpo in html"
- "success": true,
- "message": ""
Delete all the emails related to a given sending
Delete the receipt and the delivery verification of a sent email from your INBOX
Authorizations:
path Parameters
code required | string Example: 2020082610003492 Code returned at the time of sending the PEC |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/send/%7Bcode%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 401
- 404
- "success": true,
- "message": "Operation succefull"
Send a PEC to the recipient sent
Send a PEC to the recipient sent and return the identification code of the shipment which can be used to return the information on the confirmation of receipt and delivery emails.
Recipients can be one or many: you can either specity a single address or an array of recipients
Please note that the this endpoint can handle up to 1 request/second.
Authorizations:
Request Body schema: application/json
sender | string |
string or Array of strings Send a mail to one or multiple recipients. This field accepts either a string or an array of strings. | |
subject | string |
body | string |
object (Attachment) | |
username | string |
password | string |
Responses
Response Schema: application/json
success | boolean |
message | string |
message_id | string |
sent | integer The number of PEC emails that have been sent |
Request samples
- Payload
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
- "subject": "Invio di prova pec massiva",
- "body": "Salve, questa rappresenta una prova di invio, che prevede un <b>corpo in html</b>",
- "attachments": [
- {
- "name": "allegato1.png",
- "file": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNMEgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQ1RTFGMzU5NzA3RTExRTdBRjRFRTc2MUNCMDFEREIzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQ1RTFGMzVBNzA3RTExRTdBRjRFRTc2MUNCMDFEREIzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOml......"
- "username": "your_pec_username",
- "password": "your_pec_password"
Response samples
- 201
- 400
- 401
- 500
- "success": true,
- "sent": 1,
- "message": "",
- "message_id": "2020082610003492"
Returns a single message in the INBOX
Returns a single message. Please note that the body will be a string encoded in x-www-form-urlencoded
Authorizations:
path Parameters
id required | number Example: 3 The id of the message that you got from /inbox |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Response Schema: application/json
object (InboxSingle) | |
success | boolean |
message | string |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/inbox/%7Bid%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 401
- 404
- "data": {
- "date": "Mon, 21 Sep 2020 15:26:37 +0200",
- "object": "ACCETTAZIONE: Invio di prova pec massiva 202009211526363",
- "body": "This is an example body."
- "success": true,
- "message": ""
Delete an email
Delete the receipt and the delivery verification of a sent email from your INBOX
Authorizations:
path Parameters
id required | number Example: 3 The id of the message that you got from /inbox |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/inbox/%7Bid%7D"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 401
- "success": true,
- "message": "Message deleted"
Get a list of emails in your inbox
Returns the content of your INBOX. Results can be paginated: each page contains up to 25 messages and have a unique ID that you can later use to get the single messsage or delete it.
Additionally, you can also query using the 'q' parameter. Please note that searching on a very populated mailbox can be slow.
Authorizations:
query Parameters
q | string Search criteria |
page | number Current page |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Response Schema: application/json
Array of objects (InboxSearch) | |
success | boolean |
message | string |
page | number |
total | number |
n_of_pages | number |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/inbox?q=SOME_STRING_VALUE&page=SOME_NUMBER_VALUE"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 401
- "data": [
- {
- "date": "Wed, 26 Aug 2020 10:00:35 +0200",
- "object": "ACCETTAZIONE: Invio di prova pec massiva 2020082610003492",
- "id": 1
- {
- "date": "Wed, 26 Aug 2020 10:00:35 +0200",
- "object": "POSTA CERTIFICATA: Invio di prova pec massiva 2020082610003492",
- "id": 2
- {
- "date": "Wed, 26 Aug 2020 10:00:36 +0200",
- "object": "CONSEGNA: Invio di prova pec massiva 2020082610003492",
- "id": 3
- "success": true,
- "message": "",
- "total": 981,
- "page": 39,
- "n_of_pages": 39
Returns the usage of you INBOX
Returns information on the usage quota of your INBOX in megabyte
Authorizations:
path Parameters
mailbox required | string Example: inbox The mailbox to check. You might use 'INBOX' to check the status of your main mailbox |
header Parameters
x-username required | string Username of Email to check |
x-password required | string Password of Email to check |
Responses
Response Schema: application/json
object (QuotaResponse) | |
success | boolean |
message | string |
Request samples
- C + Libcurl
- Csharp + Restsharp
- Go + Native
- Java + Okhttp
- Java + Unirest
- Javascript + Jquery
- Javascript + Xhr
- Node + Native
- Node + Request
- Node + Unirest
- Objc + Nsurlsession
- Ocaml + Cohttp
- Php + Curl
- Php + Http1
- Php + Http2
- Python + Python3
- Python + Requests
- Ruby + Native
- Shell + Curl
- Shell + Httpie
- Shell + Wget
- Swift + Nsurlsession
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://ws.pecmassiva.com/quota/inbox"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "x-username: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "x-password: SOME_STRING_VALUE"); headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response samples
- 200
- 400
- 401
- "data": {
- "usage": 171012,
- "limit": 1048576
- "success": true,
- "message": ""