eDoreczenia_ReceiveMessage
The eDoreczenia_ReceiveMessage() function downloads the entire message from the e-Doręczenia system (PURDE/PUH service) and fulfills the current case with the message content (ie. a message text, attachments and evidences). The message is marked as READ in the e-Doręczenia system.
Syntax
eDoreczenia_ReceiveMessage(mailboxId, messageId);
Function arguments
- mailboxId – (String) an identifier of the mailbox from which the message will be received. The mailbox has to be registered in AMODIT with unique id.
- messageId – (String) an identifier of the message to be received from e-Doręczenia.
Return value
The eDoreczenia_ReceiveMessage() function returns Object.
This complex object contains the following properties:
- Success – returns True, if the operation succeeds;
- CombinedErrorMessage – returns a description of the error in case of the operation failure;
- AllEvidencesNum, ProcessedEvidencesNum, IgnoredEvidencesNum and UnprocessedEvidencesNum – all these four properties inform about processing of evidences connected with the received message.
Examples
Example 1
In this example the eDoreczenia_ReceiveMessage() function will receive the selected message from the chosen e-Delivery mailbox, which is registered in AMODIT as 'TestMailbox1′. The message to be received is selected by an ID taken from the value in field 'MessageId’ on the case. A result of the function execution returned as complex object allows to check an operation status (property: Success) and optionally obtains an error message (property: CombinedErrorMessage).
_mailboxId="TestMailbox1"; _messageId=[MessageId]; result = eDoreczenia_ReceiveMessage(_mailboxId, _messageId); if (!result.Success) { ShowMessage(1, result.CombinedErrorMessage); }