-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpecmassiva.openapi.json
More file actions
1 lines (1 loc) · 12.9 KB
/
Copy pathpecmassiva.openapi.json
File metadata and controls
1 lines (1 loc) · 12.9 KB
1
{"openapi":"3.0.0","info":{"title":"PEC Massiva 1.0","description":"This service offers rest calls to send massive pecs and check the status of the delivery verification and receipt verification emails","termsOfService":"https://openapi.it/en/terms-and-conditions","contact":{"url":"https://openapi.it/en/support","name":"Support"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.0"},"servers":[{"url":"https://ws.pecmassiva.com","description":"Production server"},{"url":"https://test.ws.pecmassiva.com","description":"Test server"}],"paths":{"/send/{code}":{"get":{"tags":["PEC"],"description":"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","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"code","in":"path","description":"Code returned at the time of sending the PEC","required":true,"schema":{"type":"string","example":"2020082610003492"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ResponseStatus"}},"success":{"type":"boolean"},"message":{"type":"string"}}},"example":{"data":[{"sender":"posta-certificata@pecmassiva.com","recipient":"dev-api@pecmassiva.com","data":"Wed, 26 Aug 2020 10:00:35 +0200","object":"ACCETTAZIONE: Invio di prova pec massiva 2020082610003492","message":""},{"sender":"\"Per conto di: dev-api@pecmassiva.com\" ","recipient":"\"dev-api@pecmassiva.com\" ","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"},{"sender":"posta-certificata@pecmassiva.com","recipient":"dev-api@pecmassiva.com","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":""}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}},"404":{"description":"Not Found","content":{"application/json":{"example":{"success":false,"message":"Result empty"}}}}},"summary":"List of all the emails related to a given sending","security":[{"bearerAuth":[]}]},"delete":{"tags":["PEC"],"description":"Delete the receipt and the delivery verification of a sent email from your INBOX","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"code","in":"path","description":"Code returned at the time of sending the PEC","required":true,"schema":{"type":"string","example":"2020082610003492"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"success":true,"message":"Operation succefull"}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}},"404":{"description":"Not Found","content":{"application/json":{"example":{"success":false,"message":"Email not found"}}}}},"summary":"Delete all the emails related to a given sending","security":[{"bearerAuth":[]}]}},"/send":{"post":{"tags":["PEC"],"summary":"Send a PEC to the recipient sent","description":"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. <br>Recipients can be one or many: you can either specity a single address or an array of recipients <br><br><b>Please note that the this endpoint can handle up to 1 request/second.</b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestSend"},"example":{"sender":"dev-api@pecmassiva.com","recipient":["dev-api@pecmassiva.com"],"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"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"message_id":{"type":"string"},"sent":{"description":"The number of PEC emails that have been sent","type":"integer"}}},"example":{"success":true,"sent":1,"message":"","message_id":"2020082610003492"}}}},"400":{"description":"Post parameter is not valid","content":{"application/json":{"example":{"success":false,"message":"Post parameter is not valid"}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}},"500":{"description":"MySQL Error","content":{"application/json":{"example":{"success":false,"message":"MySQL Error {error code}"}}}}},"security":[{"bearerAuth":[]}]}},"/inbox/{id}":{"get":{"tags":["Inbox"],"description":"Returns a single message. Please note that the body will be a string encoded in x-www-form-urlencoded","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The id of the message that you got from /inbox","required":true,"schema":{"type":"number","example":3}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboxSingle"},"success":{"type":"boolean"},"message":{"type":"string"}}},"example":{"data":{"sender":"posta-certificata@pecmassiva.com","recipient":"altravia@pecmassiva.com","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":""}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}},"404":{"description":"Not Found","content":{"application/json":{"example":{"success":false,"message":"Message not found"}}}}},"summary":"Returns a single message in the INBOX","security":[{"bearerAuth":[]}]},"delete":{"tags":["Inbox"],"description":"Delete the receipt and the delivery verification of a sent email from your INBOX","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The id of the message that you got from /inbox","required":true,"schema":{"type":"number","example":3}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"success":true,"message":"Message deleted"}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}}},"summary":"Delete an email","security":[{"bearerAuth":[]}]}},"/inbox":{"get":{"tags":["Inbox"],"description":"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. <br> Additionally, you can also query using the 'q' parameter. Please note that searching on a very populated mailbox can be slow.","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Search criteria","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Current page","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboxSearch"}},"success":{"type":"boolean"},"message":{"type":"string"},"page":{"type":"number"},"total":{"type":"number"},"n_of_pages":{"type":"number"}}},"example":{"data":[{"sender":"posta-certificata@pecmassiva.com","recipient":"dev-api@pecmassiva.com","date":"Wed, 26 Aug 2020 10:00:35 +0200","object":"ACCETTAZIONE: Invio di prova pec massiva 2020082610003492","id":1},{"sender":"\"Per conto di: dev-api@pecmassiva.com\" ","recipient":"\"dev-api@pecmassiva.com\" ","date":"Wed, 26 Aug 2020 10:00:35 +0200","object":"POSTA CERTIFICATA: Invio di prova pec massiva 2020082610003492","id":2},{"sender":"posta-certificata@pecmassiva.com","recipient":"dev-api@pecmassiva.com","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}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}}},"summary":"Get a list of emails in your inbox","security":[{"bearerAuth":[]}]}},"/quota/{mailbox}":{"get":{"tags":["Inbox"],"description":"Returns information on the usage quota of your INBOX in <b>megabyte</b>","parameters":[{"name":"x-username","in":"header","description":"Username of Email to check","required":true,"schema":{"type":"string"}},{"name":"x-password","in":"header","description":"Password of Email to check","required":true,"schema":{"type":"string"}},{"name":"mailbox","in":"path","description":"The mailbox to check. You might use 'INBOX' to check the status of your main mailbox","required":true,"example":"inbox","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QuotaResponse"},"success":{"type":"boolean"},"message":{"type":"string"}}},"example":{"data":{"usage":171012,"limit":1048576},"success":true,"message":""}}}},"400":{"description":"Invalid mailbox","content":{"application/json":{"example":{"success":false,"message":"An error occured: the requested mailbox might be unavailable"}}}},"401":{"description":"Authorization is not valid or empty","content":{"application/json":{"example":{"success":false,"message":"Authorization is not valid or empty"}}}}},"summary":"Returns the usage of you INBOX","security":[{"bearerAuth":[]}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"QuotaResponse":{"type":"object","properties":{"usage":{"type":"number"},"limit":{"type":"number"}}},"InboxSingle":{"type":"object","properties":{"sender":{"type":"string"},"recipient":{"type":"string"},"date":{"type":"string"},"object":{"type":"string"},"body":{"type":"string"}}},"InboxSearch":{"type":"object","properties":{"sender":{"type":"string"},"recipient":{"type":"string"},"date":{"type":"string"},"object":{"type":"string"},"id":{"type":"number"}}},"ResponseStatus":{"type":"object","properties":{"sender":{"type":"string"},"recipient":{"type":"string"},"data":{"type":"string"},"object":{"type":"string"},"message":{"type":"string"}}},"Attachment":{"type":"object","properties":{"name":{"type":"string"},"file":{"type":"string","format":"base64encode"}}},"RequestSend":{"type":"object","properties":{"sender":{"type":"string"},"recipient":{"description":"Send a mail to one or multiple recipients. This field accepts either a string or an array of strings.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"attachments":{"$ref":"#/components/schemas/Attachment"},"username":{"type":"string"},"password":{"type":"string"}}}}},"externalDocs":{"description":"First time here? Generate a new access token","url":"https://console.openapi.com/oauth"}}