Function eDoreczenia_DownloadArchivedMessage() downloads a given message content and all related elements (i.e. attachments and evidences) as a zipped archive (.zip) file from the e-Doręczenia system (PURDE/PUH service). The downloaded file can be saved into one of these places:

  • external location (i.e. local drive of the server that hosts the AMODIT application or network share);
  • the specified field on the case form;
  • the case document list.


eDoreczenia_DownloadArchivedMessage(mailboxId, messageId, storageInfo);

Function arguments

  • mailboxId – (String) an identifier of the mailbox that stores the given message to be archived. The mailbox has to be registered in AMODIT with unique id.
  • messageId – (String) an identifier of the message to be archived.
  • storageInfo – (Object) this argument defines a place where the zipped archive with the message content and its dependencies (i.e. evidences and attachments) will be stored.

Return value

This eDoreczenia_DownloadArchivedMessage() function returns Object.
This complex object contains the following properties:

  • Success – returns True, if the operation succeeds;
  • CombinedErrorMessage – returns description of an error in case of the operation failure.


Example 1

In this example eDoreczenia_DownloadArchivedMessage() function downloads a zipped archive with the message content and all related elements (i.e. attachments and evidences). The message is selected by its ID stored in the field 'messageId’. The file with the zipped archive will be saved in the shared location '\\my-networkshare\folder1′.

// select the mailbox by passing its id
mailboxId = 'TestMailbox1';

// choose type of storage, available values: 'externalLocation', 'listOfDocuments' and 'field'
storageInfo.storageType = [storageType];

// set a name for the file with a zipped archive with message content (optional)
storageInfo.filename = [filename];

// set the name of the field where downloaded file with a zipped archive should be placed
// (property is required only when storageType is set to 'field')
storageInfo.fieldName = [fieldName];

// set the external location where file with a zipped archive will be placed
// (property is required only when storageType is set to 'externalLocation')
storageInfo.externalLocation = [location];

// set a flag to true in order to allow for overriding attachments
storageInfo.overrideAttachment = true;

// execute the function with previously prepared arguments
response = eDoreczenia_DownloadArchivedMessage(mailboxId, [messageId], storageInfo);
if (!response.Success) // verify a status of operation
  ShowMessage(1,response.CombinedErrorMesage); // display an error message in case of failure


Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
How Can We Improve This Article?