{datovka:conf:to:annotation:attachments:params:ret_url:related_to}

Description

Sends a message through the Czech Data Box system (datova schranka / Mojedatovaschranka). This is a side-effect command: it always returns an empty string, and on a valid send it redirects the browser to the Data Box login service to authorize and dispatch the message. Use it with care - it can trigger a send on every page load. The conf parameter controls whether anything is sent: empty (or any value other than 1, test, or standard) is a safe no-op that returns the empty string and does nothing; test sends to the testing server; 1 or standard send for real. The to, annotation, and attachments parameters are all required for a send; if any is missing the command is a no-op. attachments is one URL, a JSON array of URLs, or a JSON object mapping display names to URLs. The optional params is a JSON object of extra envelope fields (dmToHands, dmRecipientRefNumber, and similar). ret_url is where the service returns after sending (the current page by default), and related_to may be an item id to associate with the message. To review messages sent from a site use the oitem and oids commands on the datovka object.

Parameters

conf required default (empty - no-op)

Send mode. Use 1 or standard for a real production send, test to send to the testing server, or leave empty (the default) for a safe no-op that sends nothing and returns an empty string. Any unrecognized value is treated as a no-op.

to required default (none)

Recipient Data Box ID (dbIDRecipient), up to 7 characters. Required for a send.

annotation required default (none)

Message annotation (dmAnnotation) - the subject line of the Data Box message, up to 255 characters. Required for a send.

attachments required default (none)

Attachments to send. One URL, a JSON array of URLs, or a JSON object mapping display names to URLs. Required for a send.

params optional default (none)

Optional JSON object of extra envelope fields, for example dmToHands, dmRecipientRefNumber, dmRecipientIdent, dmSenderRefNumber, dmLegalTitleLaw, dmLegalTitleYear. Omitted by default.

ret_url optional default (current page)

URL the Data Box service returns to after the send. Defaults to the current page.

related_to optional default (none)

Optional item id to associate the message with an AA item, so you can trace it later.

Examples

test[{datovka:}]
Expected[]
Actual[]
With no parameters the command does nothing and returns an empty string. Datovka only acts when conf is 1, test, or standard AND to, annotation, and attachments are all provided.
test[{datovka::bkfj8cu:Annual report:https://example.org/report.pdf}]
Expected[]
Actual[]
An empty conf (the leading empty segment) is a safe no-op even with a full recipient, annotation, and attachment - the output is still empty. Change the empty conf to 1, test, or standard to actually send.
test[{datovka:1:bkfj8cu:Annual report}]
Expected[]
Actual[]
Even with conf set to 1, the send is skipped when a required argument is missing (here attachments). The command returns an empty string and does nothing.
test[{datovka::bkfj8cu:Two files:["https://example.org/a.png","https://example.org/b.png"]}]
Expected[]
Actual[]
attachments may be a JSON array of URLs to send several files. Shown here with an empty conf so it stays a no-op; set conf to test or 1 to dispatch the two files.
test[{datovka::bkfj8cu:Reports:{"Report 1":"https://example.org/report.pdf","Report 2":"https://example.org/rep2.docx"}}]
Expected[]
Actual[]
attachments may be a JSON object mapping display names to URLs, so each file shows a readable label in the Data Box. Empty conf keeps it a no-op here.
test[{datovka::bkfj8cu:Report:{"Report":"https://example.org/report.pdf"}:{"dmToHands":"Honza Malik","dmRecipientRefNumber":"vcj. 253"}}]
Expected[]
Actual[]
The fifth argument params is a JSON object of optional envelope fields such as dmToHands and dmRecipientRefNumber. Shown with an empty conf as a no-op; set conf to 1, test, or standard to send.