---
title: "DAS .NET API for document automation"
canonical_url: "https://www.nutrient.io/guides/document-automation-server/document-conversion/autobahn-dx-net-api/"
md_url: "https://www.nutrient.io/guides/document-automation-server/document-conversion/autobahn-dx-net-api.md"
last_updated: "2026-06-08T17:26:16.293Z"
description: "Leverage the Document Automation Server .NET API to execute job definitions and streamline workflows with provided code examples."
---

# Efficiently execute jobs with the DAS .NET API

The Document Automation Server (DAS).NET API allows a.NET application to execute a selected job definition.

A sample Visual Studio project is provided in the `<Autobahn DX installation folder>\code examples\AutobahnAPIExample` folder.

## API example (local job)

```csharp

/// <summary>
        /// Call Autobahn and run specified JobID
        /// </summary>
        /// <param name="jobID">The Autobahn JobID</param>
        /// <param name="configFile">Full file path to the Autobahn config file</param>
        /// <param name="timeOut">Time out in ms. Default is zero which is no time out</param>
        /// <returns>Exit Code - zero is success</returns>
        public int Call(int jobID, string configFile, int timeOut = 0)
        {
            int exitCode;
            Job job = null;
            try
            {
                // Create new Job instance for the supplied JobID and the Autobahn config file
                job = new Job(jobID, configFile);
                // Start the job
                job.Start();
                // If a time out value is supplied, wait until time out complete
                if (timeOut > 0)
                {
                    job.WaitForExit(timeOut);
                }
                else
                {
                    string started = job.JobFinished();
                    job.WaitForExit();
                    Console.WriteLine("Job execution finished:" + job.JobFinished());
                    Console.WriteLine("Exit code is:" + job.Jobstatus());
                }
                // Job status analysis
                if (job.Jobstatus().ToUpper().Equals("ERROR"))
                {
                    exitCode = -1;
                }
                else if (job.Jobstatus().ToUpper().Equals("STOPPED"))
                {
                    if (job.JobFinished().ToUpper().Equals("TRUE"))
                    {
                        exitCode = 0;
                    }
                    else
                    {
                        exitCode = -1;
                    }
                }
                else
                {
                    exitCode = -2;
                }
            }
            catch (Exception ex)
            {
                exitCode = -1;
                Console.WriteLine(ex.Message);
            }
            finally
            {
                if (job!= null)
                {
                    job.Dispose();
                }
            }
            return exitCode;
        }

```

## API details

| Constructors                                   |                                                                                                                         |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `public Job(int jobid)`                        | Create a Job object using an existing jobid.                                                                            |
| `public Job(string jobdeffile)`                | Create a Job object using a temporary job definition file.                                                              |
| `public Job(int jobid, string config)`         | Create a Job object using an existing jobid and config file with the configuration of the remote machine.               |
| `public Job(string jobdeffile, string config)` | Create a Job object using a temporary job definition file and config file with the configuration of the remote machine. |

| Methods                                             |                                                                                                                                                                                                        |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `public Start()`                                    | Starts the Job.                                                                                                                                                                                        |
| `public void WaitForExit(int ms)`                   | Waits for the job to exit, for up to ms milliseconds. The job is stopped if it has not completed.                                                                                                      |
| `public void WaitForExit()`                         | Waits indefinitely for the job to complete.                                                                                                                                                            |
| `public virtual void Dispose()`                     | Disposes of the resources associated with the Job.                                                                                                                                                     |
| `Public string Jobstatus()`                         | Returns the status of the job which may be either Stopped or Error. This should be checked in conjunction with the value of JobFinished() to determine whether the job completed before being stopped. |
| `Public string JobFinished()`                       | Indicates whether the job has completed (return value True) or has been stopped (return value False) as a result of timeout being exceeded.                                                            |
| `Public void ClearError(string JobStatusPath)`      | When a job is error, ClearError(string jobStatusPath) will clear the error job and set the job status to stopped.                                                                                      |
| `Public string GetLastRunDate()`                    | Returns the last Date and Time the job executed.                                                                                                                                                       |
| `Public List<DocumentResults> GetDocumentsStatus()` | Returns a list of files processed and their status.                                                                                                                                                    |

---

## Related pages

- [Comprehensive guide to document automation servers](/guides/document-automation-server/document-conversion/acknowledgments.md)
- [Essential configuration files for Document Automation Server](/guides/document-automation-server/document-conversion/autobahn-dx-configuration-files.md)
- [Explore document automation server directories](/guides/document-automation-server/document-conversion/autobahn-dx-directories.md)
- [Streamline your document processing jobs](/guides/document-automation-server/document-conversion/autobahn-dx-quick-start.md)
- [Split and rename PDF files using barcode detection](/guides/document-automation-server/document-conversion/barcode-support.md)
- [Streamline PDF management with advanced automation](/guides/document-automation-server/document-conversion/dascontentextraction-kingfisher-job-step.md)
- [Streamline your document conversion processes](/guides/document-automation-server/document-conversion.md)
- [Optimizing load balancing with distributed polling](/guides/document-automation-server/document-conversion/distributed-polling.md)
- [Managing Windows file name length in DAS](/guides/document-automation-server/document-conversion/file-name-length.md)
- [Enhanced cloud OCR capabilities for text recognition](/guides/document-automation-server/document-conversion/cloud-ocr.md)
- [Enhance document processing with the .NET SDK](/guides/document-automation-server/document-conversion/gdpicture-additional-steps.md)
- [Essential document automation server installation guide](/guides/document-automation-server/document-conversion/installation-and-licensing.md)
- [Enhance document processing with multicore support](/guides/document-automation-server/document-conversion/multicore-support.md)
- [Optimize OCR with advanced preprocessing options](/guides/document-automation-server/document-conversion/ocr-properties-file-and-the-advanced-pre-processing-option.md)
- [Streamline document automation with XML job definitions](/guides/document-automation-server/document-conversion/job-definition-xml-files.md)
- [Extract key-value pairs from PDFs to JSON](/guides/document-automation-server/document-conversion/pdf-recognition-to-json-job-step.md)
- [Streamline document processing with automation](/guides/document-automation-server/document-conversion/product-overview-and-concepts.md)
- [Effortlessly convert files to PDF with ToPDF](/guides/document-automation-server/document-conversion/topdf-bcl-easypdf.md)
- [Upgrade Document Automation Server](/guides/document-automation-server/document-conversion/release-notes.md)
- [Automate document processing with custom scripts](/guides/document-automation-server/document-conversion/scripting-custom-steps.md)

