edoc automate Guide
Breadcrumbs

document - edoc automate action

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

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"
                ]
            ]
        ]
    ]
);