edoc automate Guide
v26.11.6 v26.9.8 German English
Auto Light Dark
Auto Light Dark
v26.11.6 v26.9.8 German English

document - edoc automate action

The following actions are available for interacting with edoc documents service:

Schema names, labels, and errors

The technical schema name remains the value used for selection fields and API calls. For display purposes, the label in the current language is used; otherwise, the first available translation is used. If no suitable label is available, the technical schema or attribute name is displayed, and a structured warning is logged.

Schema entries without a valid technical name are omitted from lists. In the case of duplicate names, the first valid entry is retained. Both are logged along with the endpoint and entry position; complete responses and document data are not logged. A valid empty schema list results in an empty selection. In contrast, invalid schema responses, invalid JSON, and failed schema retrievals—including timeouts—generate an explicit error, not an apparently successful empty list.

Things to know
The functions in connection with schemas were not created as actions due to their complexity. Instead, you can create an instance of the DocumentService class in the PHP code (e.g. in a plug-in action) and use the following functions:

  • getSchemas(): array

  • getSchema(string $schemaName): array

  • saveSchema(string $schemaName, array $data): void

  • deleteSchema(string $schemaName): void

  • getSchemaWebhooks(string $schemaName, string $appName): array

  • saveSchemaWebhooks(string $schemaName, string $appName, array $data): void

  • deleteSchemaWebhooks(string $schemaName, string $appName): void

Example:

PHP
$dsClient = \edoc\appserver\services\DocumentService::GetInstance();
$dsClient->saveSchema(
    'order-confirmation.active',
    [
        "label": [
            "de": "Auftragsbestätigung | Aktiv",
            "en": "Order confirmation | Active"
        ],
        "attributes" => [
            "order_description": [
                "type": "nullable|string",
                "label": [
                    "de": "Beschreibung",
                    "en": "Description"
                ]
            ],
            "vendor_id": [
                "type": "nullable|string",
                "label": [
                    "de": "Lieferanten-Nr.",
                    "en": "Vendor ID"
                ]
            ]
        ]
    ]
);

Last updated: