Skip to content

Integration Tests

When integrating two systems, it is crucial to have comprehensive integration tests in place. While testing successful cases is straightforward, it is equally important to verify that exception cases are handled correctly.

To help you test your integration with Werk24’s API, we provide example files that trigger expected exceptions. These files allow you to simulate different scenarios and confirm that your system correctly interprets error responses.

Each sample is a billed read

There is no test mode: every sample you submit is a real read, billed like any other. That includes the samples that end in an exception whose cause is on the submitting side: an unsupported format, a resolution too low, too many pages, an incorrect configuration. The unsupported-format sample is billed on both routes, although the HTTP route refuses it with a 415 before it is read. Only an oversized drawing is refused without a charge, before the read starts on either route. Run the samples when you change your error handling, not on every CI run.

If you receive results at a callback URL, test that receiver before you submit samples to it. A receiver that answers 400, 401, 404 or another status that is not retried ends the read, and the read stays charged. See Delivery rules.

Success Cases

Simple Success File

The simplest integration test is a successful submission.

✅ Expected Outcome: The API processes the drawing without errors.

DRAWING_SUCCESS_UNSUPPORTED

Exception Cases

Each of the following test cases simulates a specific exception scenario that may occur when submitting a technical drawing to the Werk24 API.

DRAWING_FILE_FORMAT_UNSUPPORTED

Werk24 supports a range of file formats (see Drawing File Format Limitations). If you submit an unsupported format, the API returns: DRAWING_FILE_FORMAT_UNSUPPORTED

DRAWING_FILE_FORMAT_UNSUPPORTED

DRAWING_FILE_SIZE_TOO_LARGE

Werk24 enforces a file size limit (see Drawing File Size Limitations). If you submit a file over this limit with read_drawing, the Python client reports DRAWING_FILE_SIZE_TOO_LARGE on each ask. Version 2.7.0 is the exception: it raises a TypeError instead, which is fixed in versions newer than 2.7.0. Submitted with read_drawing_with_callback, the same file is never processed. Versions newer than 2.7.0 raise CallbackDrawingTooLargeException before sending it. Version 2.7.0, a stream that cannot seek, or a direct POST without the Python client sends it, and the request is refused without a request_id.

DRAWING_FILE_SIZE_TOO_LARGE

DRAWING_RESOLUTION_TOO_LOW

Werk24 requires a minimum resolution for technical drawings to ensure accurate processing (see Resolution Limitations).If an image’s resolution falls below this threshold, the API will return a DRAWING_RESOLUTION_TOO_LOW exception.

DRAWING_RESOLUTION_TOO_LOW

DRAWING_CONTENT_NOT_UNDERSTOOD

If the submitted file is not a technical drawing (e.g., an invoice, contract, or blank page), or if the drawing is incomplete or implausible, the API will return a DRAWING_CONTENT_NOT_UNDERSTOOD exception.

DRAWING_CONTENT_NOT_UNDERSTOOD

CONFIGURATION_INCORRECT

If the request configuration is incomplete or malformed, the API returns CONFIGURATION_INCORRECT. This requires client version 2.3.0 or newer; older clients receive DRAWING_CONTENT_NOT_UNDERSTOOD instead.

DRAWING_PAGE_COUNT_TOO_LARGE

For outputs that must cover the whole document (e.g. redaction), Werk24 limits the input to 5 pages. If you submit a document with more pages, the API returns DRAWING_PAGE_COUNT_TOO_LARGE. This is only sent to clients reporting a version newer than 2.5.0 (Python client 2.6.0 or newer); clients on 2.5.0 or older receive no redaction result and no error instead.