Skip to content

About

beA.expert API for PHP: read, send and manage beA messages from your own software. Maintained at gitlab.com/beaexpert/bea-api-php.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

beA-PHP-API Version 3.0

Dieses PHP-Script 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
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 and the qeS functions, 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) returns token and payload (PDF, base64) or token and error; with a file name as 4th parameter the PDF is also saved.

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.

Also added, as in the Python library: bea_logout, 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: the login signature is created with openssl cms -sign -binary (the challenge is signed byte for byte) and the temporary folder with the private key is removed after signing; bea_get_message and bea_get_folderoverview return the response of the API unchanged if it contains an error; sizeKB of an attachment is the size of the file; bea_init_message_draft returns the decrypted subject in msg_infos; messages and drafts with exactly one attachment are decrypted.

test_all_functions.php shows all calls.

Dependencies

  • phpseclib 1.0 (Crypt/RSA.php)
  • PHP extensions: curl, openssl, json, simplexml
  • openssl command line tool (login)

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 PHP: read, send and manage beA messages from your own software. Maintained at gitlab.com/beaexpert/bea-api-php.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages