Skip to content

Exports

XDENT Enterprise uses an asynchronous export processing model. An export is not processed synchronously when the request is sent – instead it is queued and processed in the background. The export result is downloaded after processing is complete.

Status diagram overview

POST /ExportRequest/{type}


      QUEUED ──── DELETE /Cancel/{id} ──► CANCELLED


    PROCESSING

    ┌────┴────┐
    ▼         ▼
COMPLETED   FAILED ──► (automatic retry)

                       (after exhausting retries)


                          CANCELLED

Step 1 – Submit the export request

Call the appropriate POST endpoint based on the type of data you want to export.

The API responds with an object containing the export identifier and status QUEUED. The export is queued and will be processed in the background.

Export options

All exports accept the following optional query parameters:

ParameterTypeRequiredDescription
formatstringnoOutput format: JSON, CSV (default: JSON)
passwordstringnoPassword for encrypting the output ZIP file
emailstringnoEmail for notification when the export completes
callbackstringnoWebhook URL – the API will send a POST request with export data (not the result) to this URL when processing is complete

Output formats

FormatDescription
JSONResult as a JSON file
CSVResult as a CSV file with tabular data

Warning

Not every export type supports all formats. See export types overview.

Step 2 – Track processing status

If no post-processing notification is set (email/webhook), you can query the export status:

http
GET /api/v1/ExportResult/Status/3fa85f64-5717-4562-b3fc-2c963f66afa6
X-Api-Key: YOUR_API_KEY

Status descriptions

StatusDescription
QUEUEDExport is waiting in the queue, processing has not yet started
PROCESSINGExport is actively being processed, the file is being generated
COMPLETEDProcessing complete, file is ready for download
FAILEDProcessing failed, the system will automatically retry
CANCELLEDExport has been permanently cancelled – either manually or after exhausting all retries

Automatic retry

If processing fails (FAILED), the system automatically tries to regenerate the export. Only after exhausting the maximum number of retries does the export move to CANCELLED status.

To list all waiting exports:

http
GET /api/v1/ExportResult/Queued
X-Api-Key: YOUR_API_KEY

Step 3 – Processing result

After transitioning to COMPLETED or FAILED/CANCELLED, the response also contains a result field:

FieldTypeDescription
result.successbooleanWhether processing completed successfully
result.errorsarrayList of error messages (if processing failed)
result.durationMsintProcessing time in milliseconds
result.fileSizeBytesintOutput file size in bytes
result.callbackSentbooleanWhether the callback was successfully sent
result.notifyEmailSentbooleanWhether the notification email was successfully sent

Step 4 – Download the result

Once the status is COMPLETED, download the result file:

http
GET /api/v1/ExportResult/Download/3fa85f64-5717-4562-b3fc-2c963f66afa6
X-Api-Key: YOUR_API_KEY

The response is a zip file. This file may be password-protected if the password query parameter was set for the export. Inside you will find the export file(s) in the default format, or in the format specified by the format query parameter.

Cancelling a queued export

An export that has not yet been picked up for processing (status QUEUED) can be cancelled:

http
DELETE /api/v1/ExportRequest/Cancel/3fa85f64-5717-4562-b3fc-2c963f66afa6
X-Api-Key: YOUR_API_KEY

Exports in PROCESSING, COMPLETED or FAILED status cannot be cancelled – returns 404.

Notifications and callback

Email notification

Add the email parameter to the export request. After processing completes (or fails) you will receive a notification at the given address.

http
POST /api/v1/ExportRequest/Invoices?format=JSON&email=integration@company.com

Webhook callback

Add the callback parameter with your application URL. After processing completes, the API sends an HTTP POST to that address with the following data:

FieldTypeDescription
idExportJobuuidJob identifier
exportTypestringExport type code
successbooleanWhether processing completed successfully
statusstringFinal status (COMPLETED, FAILED, CANCELLED)
errorMessagesarrayList of errors (if processing failed)
durationMsintProcessing time in milliseconds
fileNamestringOutput file name
fileSizeBytesintFile size in bytes

Implementation recommendations

  • Use callback or email notification to avoid actively polling the status.