# OpenProject

Follow these steps to seamlessly integrate with OpenProject:

## **Generate an API Token**

{% hint style="warning" %}
API Token User must be a **Administrator**.
{% endhint %}

1. Navigate to **Profile Photo > Account Settings** in OpenProject.<br>

   <figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2Fx5xZfYsblnhVQ9pFEmua%2FOpenProject%20Navigate-to-Profile%3EAccount-Settings.png?alt=media&#x26;token=86c824a1-0c7e-4ef7-abef-45677e438a98" alt=""><figcaption><p>OpenProject Navigate-to-Profile>Account-Settings</p></figcaption></figure>
2. Navigate to **Access Tokens**.
3. Click on **+ API token** to create new API token.<br>

   <figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FwgXTEUij72bQ4GJYZBB2%2FOpenProject-Navigate-to-Access-tokens-Chick-API-token.png?alt=media&#x26;token=f53ee860-3ec2-49e5-ac86-9f3d2dbe553d" alt=""><figcaption><p>OpenProject-Navigate-to-Access-tokens-Chick-API-token</p></figcaption></figure>
4. Assign a name to the token, for instance, `dd-token`.
5. Click on **Create** to create the API token.

{% hint style="warning" %}
This is the only time you will see this token, make sure to copy it now.
{% endhint %}

<figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FImUu8X0ZAjPNi7EyKbsA%2FOpenProject-Enter-token-name-and-click-create.png?alt=media&#x26;token=eb9a3705-67d3-4f80-b783-0b0a2b35475a" alt=""><figcaption><p>OpenProject-Enter-token-name-and-click-create</p></figcaption></figure>

## **Create Webhook**

### Steps to Create a Webhook:

1. Navigate to **Profile Photo > Administration** in OpenProject.<br>

   <figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FE96CHIeoZkFjXKBL0OVe%2FOpenProject%20Navigate-to-Profile%3EAdministration.png?alt=media&#x26;token=32a9106f-87a4-40e7-b7b3-6cccca14e3bd" alt=""><figcaption><p>OpenProject Navigate-to-Profile>Administration</p></figcaption></figure>

2. Navigate to **API and webhooks.**

<figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2F1RSOgOlw62pVJB8Xhz5X%2FOpenProject-Click-on-API-and-webhooks.png?alt=media&#x26;token=9996b5eb-1429-47ed-8953-de362099acd6" alt=""><figcaption><p>Navigate to API and Webhooks</p></figcaption></figure>

3. Navigate to **Webhooks** and Click the **+ Webhook**.

   <figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FqXselWElVONJN8SLyiHc%2FOpenProject-Navigate-to-Webhooks-%26-Click-%2BWebhook.png?alt=media&#x26;token=05fdc67e-7bd7-4da2-85eb-2104d55cbba3" alt=""><figcaption><p>Navigate to Webhooks and Click the + Webhook</p></figcaption></figure>

4. Enter a name for webhook, say `devd-webhook`.

5. Create the webhook URL for your organisation using the given template and paste it in **Payload URL** field.
   * **Template**: `https://api.devdynamics.ai/integration/issue/openproject/{OrgId}/webhook?integrationKey={OpenProjectBaseUrl}`&#x20;
     * `OpenProjectBaseUrl` : e.g. `https://orgname.openproject.com`
     * `OrgId`: Get orgId from [**https://app.devdynamics.ai/settings/organisation**](https://app.devdynamics.ai/settings/organisation)

6. Check the Enabled checkbox.

{% hint style="warning" %}
The webhook will trigger on the selected events only when the **Enabled** checkbox is checked.
{% endhint %}

<figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FA4cav2rIJvKywuye3SaR%2FOpenProject-fill-webhook-details.png?alt=media&#x26;token=67dab207-8cf2-47cb-b54c-3525ca5b1c79" alt=""><figcaption><p>Fill webhook details</p></figcaption></figure>

7. To enable all events Click **check all**.
8. Click **Create** to complete webhook creation.

{% hint style="warning" %}
Its important that you enable all events, else you might see inconsistency in Devdynamics portal.
{% endhint %}

<figure><img src="https://4171758421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS4rgvJ71tpXan8RhYTT4%2Fuploads%2FgnWvClHYiWLvpdw45USa%2FOpenProject-Enable-all-events-for-all-projects.png?alt=media&#x26;token=2feffd46-5500-49ef-80fd-01aab83f0990" alt=""><figcaption><p>Check  necessary conditions</p></figcaption></figure>

***

With these steps completed, the integration with OpenProject is successfully done!
