Przejdź do głównej zawartości

eDoreczenia_VerifyEDA

The eDoreczenia_VerifyEDA() function allows to check ability to communicate between the specified e-Delivery electronic addresses (one sender and many receivers) on behalf of the selected mailbox by passing specified verification criteria. The function returns a list of items containing basic information about these addresses:

  • status of the address;
  • type of the address owner (citizen, company, state institution, NGOs, etc.);
  • a correspondence postal address;
  • (sur)name;
  • company name;
  • NIP;
  • KRS;
  • PESEL
  • and many others.
eDoreczenia_VerifyEDA(mailboxId, verificationOptions);
  • mailboxId – (String) identifier of the mailbox on behalf of which the query will be sent. The mailbox has to be registered in AMODIT with unique id.
  • verificationOptions – (Object) the set of criteria which allows to define addresses between whom communication should be verified.

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

  • Success – returns True, if the operation succeds;
  • CombinedErrorMessage – returns the description of an error in case of the operation failure;
  • SearchStatus – a communication status of EDA (available values: ’Ok’, ’InactiveEDA’, ’NotFound’, ’Error’ and ’MoreItems’);
  • HasWarning – a flag that indicates if warining occured;
  • Warning – a description of a warning.

In this example eDoreczenia_VerifyEDA() function verifies an e-Delivery address (EDA) defined in value from field ’EDA’ on behalf of mailbox with mailbox id fetched from field ’mailboxID’. The result of function execution allows to check a communication status and decides how to handle each case.

verificationOptions.recipientEdas = [EDA];
res = eDoreczenia_VerifyEDA([mailboxId], verificationOptions);
if (!res.Success)
{
if (res.SearchStatus == 'NotFound')
{
ShowMessage(1,'Selected EDA cannot be found. Description: ' +res.CombinedErrorMessage);
}
if (res.SearchStatus == 'Error')
{
ShowMessage(1,'Error occured. ErrorDescription: ' +res.CombinedErrorMessage);
}
}
else
{
if (res.SearchStatus == 'Ok' && !res.HasWarning)
{
ShowMessage(1, 'Selected EDA has been found, is valid and accessible.
Message can be sent to the specified EDA.');
}
if (res.SearchStatus == 'Ok' && res.HasWarning)
{
ShowMessage(1, 'Selected EDA has been found, but may be inaccessible due to being forbidden
(in public e-Delivery service) communication between two non-public EDAs).' + res.Warning);
}
if (res.SearchStatus == 'InactiveEDA')
{
ShowMessage(1, 'Selected EDA has been found, but is inactive.');
}
if (res.SearchStatus == 'MoreItems')
{
ShowMessage(1, 'There were more than one EDA found. Try to apply more srtict criteria
to find the only one EDA.');
}
}