---
title: "API Getting Started"
canonical: "https://support.appfire.com/space/CDML/649595250/API%20Getting%20Started"
format: markdown
---
> Macro (aura-html)


## Overview

> ⚠️ We recommend that you are already familiar with [developing Confluence apps](https://developer.atlassian.com/confdev/confluence-plugin-guide) to use the Comala Document Management API.

Follow the steps below to add the Comala Document Management Java API to your app:

## 1. Add the `appfire-comalatech-public` maven repository in your `.m2/settings.xml`:

```xml
<repository>
	<id>appfire-comalatech-public</id>
    <url>https://nexus.appfire.com/repository/comalatech-maven-public/</url>
    <snapshots>
    	<enabled>true</enabled>
    </snapshots>
    <releases>
    	<enabled>true</enabled>
    </releases>
</repository>
```

## 2. Add a dependency to the Comala Document Management API in your `pom.xml`:

> ℹ️ This feature is only available from **Comala Document Management 6.16.0 onwards**. A corresponding API library with the same version is always available.

```xml
<dependency>
    <groupId>com.comalatech.workflow</groupId>
    <artifactId>workflows-api</artifactId>
    <version>[replace with Comala Document Management version of your choice]</version>
    <scope>provided</scope>
</dependency>
```

## 3. Import the required components

In your `atlassian-plugin.xml`:

```xml
<component-import name="Comala Workflows Services" key="workflowService"
           interface="com.comalatech.workflow.WorkflowService"/>

<component-import name="Comala State Services" key="stateService"
           interface="com.comalatech.workflow.StateService"/>

<component-import name="Comala Tasks Services" key="taskService"
           interface="com.comalatech.workflow.TaskService"/>

<component-import name="Comala Approvals Services" key="approvalService"
           interface="com.comalatech.workflow.ApprovalService"/>
           
<component-import name="Comala Document Activity API" key="documentActivitySevice" 
           interface="com.comalatech.workflow.DocumentActivityService"/>
```

Or if you are using [Atlassian Spring Scanner](https://bitbucket.org/atlassian/atlassian-spring-scanner) right inside your plugin component:

```java
    @ComponentImport
    private WorkflowService workflowService;
    
    @ComponentImport
    private StateService stateService;
    
    @ComponentImport
    private TaskService taskService;
    
    @ComponentImport
    private ApprovalService approvalService;
    
    @ComponentImport
    private DocumentActivityService documentActivityService;
```

The components are injected into your app components.

## 4. Use it!

You can now use the [API Services](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649562848) or handle [Workflow Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649923526). Access the full Javadoc documentation [here](https://comalatech.bitbucket.io/comala-workflows/index.html).