Du benytter dette endepunktet når du faktisk ønsker å sende et digitalt brev til Digipost. Fra v8 av REST APIet til Digipost ble det mulig å sende digital post med én request. Tidligere måtte en forsendelse opprettes (request #1), deretter dokumentet legges til (request #2) og til slutt forsendelsen sendes (request #3).
This end point is used to actually send digital mail to Digipost. From v6 of Digipost's REST API it became possible to send digital mail with one single request. Previously a messages needed to be created (request #1), documents added to the message (request #2) and finally a request is sent to send the message.
https://api.digipost.no/messages
http post
POST https://api.digipost.no/messages HTTP/1.1 X-Digipost-UserId: 497013 Date: Wed, 07 Dec 2016 14:47:08 GMT Accept: application/vnd.digipost-v8+xml X-Content-SHA256: cZM1trDPKy8/ygP8+LOllNv6S78AntQrZBCE+cEcJos= X-Digipost-Signature: RAdz6PqMVSQn/+0LBcRAaih8Ic9R0ccBL0aTgg1sA0SpUwje1HbM8ZeH8uxjIKXv2OLnUs/w6uONl51SzxLdF/TUGZWRMEx3063KvFdzOIyAylkRTCKo9F1ulKix0fmg0d9/WU3hC3ayPXyja9D1AbMOSb1lOdCnxDL46u28EgO1r09b27N653as4I2GQPgJJAakcCme8JDvRaxxidKVn2OCXSb10UHY/GYGtt2Xda5AtohDvKdiOZRtP31sPaLKrt+eczDDwuZoM8mNId1mdOagjnw3NSHUZj+c38M2hqUldZCHrc9LUbhnihuhvB6XiIfzJTA6Z5oLZ8+nGk7Kpg== Content-Type: multipart/vnd.digipost-v8+xml; boundary=6dc66a32-2453-44dd-8cac-cf54b3b1d0b0 Host: api.digipost.no Content-Length: 2604 Expect: 100-continue Connection: Keep-Alive --6dc66a32-2453-44dd-8cac-cf54b3b1d0b0 Content-Type: application/vnd.digipost-v8+xml Content-Disposition: attachment; filename="message" <?xml version="1.0" encoding="utf-8"?> <message xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://api.digipost.no/schema/v8"> <recipient> <personal-identification-number>01043100358</personal-identification-number> </recipient> <primary-document> <uuid>6d99008e-2672-4b55-9b09-996b09a06e47</uuid> <subject>simple-pdf-document</subject> <file-type>pdf</file-type> <authentication-level>PASSWORD</authentication-level> <sensitivity-level>NORMAL</sensitivity-level> </primary-document> </message> --6dc66a32-2453-44dd-8cac-cf54b3b1d0b0 Content-Type: text/plain Content-Disposition: attachment; filename=6d99008e-2672-4b55-9b09-996b09a06e47 %PDF-1.4 % ... ... ... 1 07 %%EOF --6dc66a32-2453-44dd-8cac-cf54b3b1d0b0--
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <message-delivery xmlns="http://api.digipost.no/schema/v8"> <delivery-method>DIGIPOST</delivery-method> <sender-id>497013</sender-id> <status>DELIVERED</status> <delivery-time>2016-12-07T08:45:32.675+01:00</delivery-time> <primary-document> <uuid>6d99008e-2672-4b55-9b09-996b09a06e47</uuid> <subject>simple-pdf-document</subject> <file-type>pdf</file-type> <authentication-level>PASSWORD</authentication-level> <sensitivity-level>NORMAL</sensitivity-level> <pre-encrypt>false</pre-encrypt> <content-hash hash-algorithm="SHA256">5o0RMsXcgSZpGsL7FAmhSQnvGkqgOcvl5JDtMhXBSlc=</content-hash> </primary-document> </message-delivery>