Skip to content

About

beA.expert API for JavaScript in the browser: read, send and manage beA messages from a web page. Maintained at gitlab.com/beaexpert/bea-api-javascript.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

beA-Javascript-API Version 3.0

Dieses beA-Javascript ermöglicht es Ihnen, den Zugriff auf das beA in Ihre Kanzleisoftware zu integrieren. Sie können das Abholen und Versenden von beA-Nachrichten in Ihrer Software und somit auch an Ihren Workflow anpassen. Wir stellen ca. 40 Funktionen rund um das beA-Postfach mit der entsprechenden Dokumentation und Beispielsoftware bereit.

Proof of concept (ForlderOverview of a beA-Account/INBOX just using a valid Softwaretoken): console.bea.expert

To use this script you need first to subscribe to a beA.expert API-Account. For more information: bea.expert/api/

New in version 3.0

Function Purpose
bea_get_userjournal journal of a user (identity SAFE-ID)
bea_get_message_pruefprotokoll "Prüfprotokoll" of a message as PDF
p7s_digest_algorithm hash algorithm (sha256, sha384, sha512, ...) used by a .p7s / .pkcs7 signature
bea_get_gericht_codes codes of the courts for msg_infos.gericht_code (code list GDS.Gerichte)
qes_get_sigtoken qualified electronic signature (qeS): sigtoken, devices and certificates of the user
qes_sign_file qeS: start the signature of one or more files
qes_get_signature qeS: poll the state of the signature, fetch the signatures

Removed: bea_get_addressbook - deprecated, the API answers "bea_get_addressbook deprecated".

Tested on 26.11.2026 against the beA test environment together with the three other libraries: every function except the address book functions, the qeS functions and bea_cleanup_message, including a message sent from each library and read by each of the others.

Prüfprotokoll: the message has to be available in the beA postbox. Attachments with a signature file (name.pdf + name.pdf.p7s or .pkcs7) are hashed with the algorithm of their signature (first signer), all other attachments with SHA-256. The request field is still called sha256; the algorithm is sent in digest_alg. bea_get_message_pruefprotokoll(token, messageId, sessionKey, pdf_file_name) returns a JSON string with token and payload (PDF, base64) or token and error; with a file name as 4th parameter the PDF is also offered as download. In the browser SHA-3 signatures are not supported (error "unsupported hash algorithm").

qeS: call qes_get_sigtoken, then qes_sign_file with one device and one certificate of its result and the files (file_name, file_b64, file_sha256_hexhash). The user confirms the signature on the device; poll qes_get_signature with the id of the transaction (e.g. every 2 seconds) until signatures or an error are returned. Every response contains a new token: always continue with the token of the last response. qes_file_entry(file_name, raw_data) creates one entry of the files list.

Also added, as in the Python library: bea_check_session, bea_get_accessrights, bea_get_configuration, bea_get_message_confirmations, bea_get_messagejournal, bea_get_postboxjournal, and the optional parameter safeId of bea_get_identitydata.

Other changes:

  • bea_get_message was defined twice, there is one definition now. It returns the response of the API unchanged if it contains an error, and its result contains the token. bea_get_folderoverview does the same.
  • All requests and the subject are sent as UTF-8: umlauts in subject, message text, search and folder names work.
  • The hash of an attachment is computed over the raw bytes and sizeKB is the size of the file.
  • Attachments with umlauts in the file name are decrypted.
  • bea_save_message and bea_send_message take an optional messageDraft ({ key, messageToken } from bea_init_message_draft) to edit a draft, as in the Python library.
  • bea_init_message_draft and bea_search send the configured bex-ident (they sent a fixed test value), and bea_init_message_draft returns the SAFE-IDs of the receivers in msg_infos.receivers.

The script posts to its own origin (/bea_...). The functions bex_login_step1-3, bea_get_postboxes, bea_get_folderoverview and bea_logout do not send the bex-ident header: the server that delivers the page has to forward the calls to the API and add it.

Examples: example_get_pruefprotokoll, example_qes_sign_file.

Dependencies

forge.min.js and jsrsasign-all-min.js (both part of this repository). No additional library is needed for version 3.0.

Licence

GPL-2.0 or BSD-3-Clause, at your option: see LICENSE.

About

beA.expert API for JavaScript in the browser: read, send and manage beA messages from a web page. Maintained at gitlab.com/beaexpert/bea-api-javascript.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages