AI translation
This page was translated from German with AI. If in doubt, the German original applies.
Attachments, incoming documents and identifiers¶
Uploading attachments, taking incoming documents over into the inventory and reading the account’s own identifiers.
Attachments¶
var response = await client.DiwassApi.AttachmentApi.SubmitAttachment(
content: pdfBytes,
typeId: AttachmentTypeId.FacilityPermit,
mimeCode: "application/pdf",
filename: "genehmigung.pdf",
containsPersonalData: false,
context: ZedalCallContext.Default.WithTimeout(600));
The overload with a pre-filled AttachmentBinaryObjectType still exists; for new code, the typed form is preferable. Reading is done via GetAttachment(attachmentIdentifier).
Always set the deadline for attachments yourself
Uploads and downloads don’t fit into the 30 seconds of the client default. Set WithTimeout(...) generously, or use WithoutDeadline() plus a CancellationToken to hand timing over to your code entirely.
The returned identifier is not necessarily the DIWASS identifier
In measured runs, the submit returns a temporary identifier of the form ZEDAL_TMP_ATT_ID_…. If a document with this identifier is sent to DIWASS, DIWASS rejects it with ATTACHMENT-NOT-FOUND — the attachment does not exist there under this identifier.
A central DIWASS attachment identifier has the form <digits>ATT. Check the identifier before you write it into a document, and treat a ZEDAL_TMP_ATT_ID_ prefix as “not yet centrally registered” rather than as success. More error codes: Error codes.
Importing incoming documents¶
client.DocumentHandler.CreateInboxImporter() returns an IInboxImporter with ImportAsTransportAsync(...), ImportToFileAreaAsync(...), and ListPendingAsync(...). The importer filters on the server via document_type, works page by page (pageSize, default 200), and returns an InboxImportReport whose Failed list names the entries that could not be imported. By default, only successfully imported entries are removed from the inbox; for unattended runs, there is removeOnFailure: true.
Why this step is not optional and what a sound synchronization cycle looks like is described under Calls and synchronization — including the Commission’s rule to use the event list plus targeted detail retrieval instead of a full export.
Your own identifiers — MyAccount¶
var operatorIds = await client.MyAccount.GetOwnDiwassOperatorIds();
// IReadOnlyList<long> — DIWASS OperatorInternalIds of this account
var bmuNumbers = await client.MyAccount.GetOwnBmuZksNumbers();
// IReadOnlyList<string> — BMU ZKS numbers (national, not numeric)
MyAccount is a facade over client.CoreApi.AccountManager.GetAccountNumbers() and filters the assigned numbers by type. You need the DIWASS operator IDs as OperatorInternalId on the DIWASS documents. Numbers that cannot be read as long are silently skipped by GetOwnDiwassOperatorIds() — so an empty list means “no matching number assigned”, not “error”.