The RED interchange API provides requests for signing electronic documents using the Telematik Infrastruktur features.

signpdf - QES for PDF document

A PDF-1A document may be signed electronically with a qualified electronic signature (QES) using the users HBA by using the signpdf request. The document must be PDF-1A with embedded fonts, any other PDF type will be rejected by the signature process.

Example for a signpdf request with HBA name and option for local file
{{baseURL}}/{{tenant}}/Bundle?action=$signpdf&cardname=HBAArzt&filepath=/Users/alexanderwilms/signedPDF.pdf

See RED Interchange API - Postman Collection 0501 - TI - Signpdf

cardname - this parameter specifies the signature card by its name. The type of card must be a Heilberufeausweis HBA. Any other type may not be used.

filepath - this is an optional parameter specifying filepath and filename. if given RED will save a local copy of the signed PDF file.


The body of the request must contain a minimized DocumentReference bundle with the PDF file as base64 string. A patient reference is not required.

Example of request body for a signpdf request
<Bundle xmlns="http://hl7.org/fhir">
    <id value="10000"/>
    <entry>
        <resource>
            <DocumentReference>
                <content>
                    <attachment>               
                        <data value="JVBERi0xLjMKJcTl8uXrp/Og0....IzNTI0Mjk0NWJiMjcxPgo8NGFmODU0ZDc2MWJjODAzMWM5MjM1MjQyOTQ1YmIyNzE+IF0gPj4Kc3RhcnR4cmVmCjQzMDU4MwolJUVPRgo="/>
                    </attachment>
                </content>
            </DocumentReference>
        </resource>
    </entry>
</Bundle>


If successful the request will return Status 200 and an XML object with signature status and signature data (the signed PDF-document as base64-String)

Example of a successful signature request
<ConnectorResponse>
    <SignatureStatus>OK</SignatureStatus>
    <SignatureData>JVBERi0xLjMKJcTl...IDwyODQ4MTM2NTg1QjNENzc3NTlFMTY0OTYwQzk3RjIxQT5dCi9QcmV2IDQzMDU4Mwo+PgpzdGFydHhyZWYKNDUxNTgzCiUlRU9GCg==</SignatureData>
</ConnectorResponse>


If unsuccessful the request returns Status 400 and an error object.

Example of an error message
<ConnectorResponse>
    <SignatureStatus>ERROR</SignatureStatus>
    <Error>No valid xml file</Error>
</ConnectorResponse>


The signed PDF document may be opened and verified in any PDF reader

  • No labels