> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refold.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Connect to your Teamwork app for OAuth.

Refold offers both **Key Based** and **OAuth 2.0** integration for Teamwork. In this guide, we will look at the OAuth App setup process.

To setup your Teamwork app in Refold for OAuth, you will need the following credentials from your [Teamwork Developer account](https://apidocs.teamwork.com/guides/teamwork/developer-portal#how-do-i-access-the-developer-portal):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Teamwork Developer account. You can create one [here](https://www.teamwork.com/signup/).

<Info>If you haven't already created an app in Teamwork, you'd need to create one.</Info>

### Creating an app in Teamwork

To create a Teamwork app and acquire the above mentioned credentials, please follow the steps mentioned below:

1. Log in to your Teamwork Developer account.
2. Click on `Create an app` button in the top right corner.

<img height="200" src="https://mintcdn.com/cobalt-55/z_Cm6DgpvP5zfZT8/images/Teamwork/teamwork_navigation.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=a0313c058bfcd53b051ccadf2da86a92" alt="Navigation for App setup" data-path="images/Teamwork/teamwork_navigation.png" />

3. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Teamwork` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.
4. Enter the `Name` for your application > Choose `Product` as **Teamwork** > Paste the Callback Url under `Redirect URIs` and click on `Create App` button.
5. Click on the app created, go to the **Credentials** tab and copy the **Client ID** and **Client Secret**.

<img height="200" src="https://mintcdn.com/cobalt-55/z_Cm6DgpvP5zfZT8/images/Teamwork/teamwork_credentials.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=a53d68a24dfcd5361090ee78f9ade382" alt="Getting Credentials" data-path="images/Teamwork/teamwork_credentials.png" />

#### Configuring credentials in Refold

App settings page lets you configure the authentication settings for an `OAuth 2.0` based application. For your customers to provide you authorization to access their data,
they would first need to install your application. This page lets you set up your application credentials.

<img height="200" src="https://mintcdn.com/cobalt-55/z_Cm6DgpvP5zfZT8/images/Teamwork/teamwork_cobalt.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=8aff2276610f8a5a3f87ad1b9edce2db" alt="Setting up application client credentials" data-path="images/Teamwork/teamwork_cobalt.png" />

Provide the acquired Client ID and Client Secret under Settings of the app and save it.

#### Publishing Teamwork App

When the app is created in the Teamwork Developer Portal, it's status is shown as **In development**. This means your app is currently in development mode and it can only be used by the Teamwork account it was created under.

Once you are ready to publish your app and make it available to all Teamwork users, please contact [integrations@teamwork.com](mailto:integrations@teamwork.com).

<Tip>
  Learn more about the pre-requisites to complete for the app publishing process [here](https://apidocs.teamwork.com/guides/teamwork/app-verification).
</Tip>

#### Actions and triggers

Once the above setup is completed, you can create orchestrations of your use-cases using Teamwork actions and triggers. Following are the set of Teamwork actions and triggers
supported by Refold.

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Project">
        1. **Get Project By Id** - Get a project details in Teamwork.
      </Accordion>

      <Accordion title="Task">
        2. **Create Task** - Create a new task in Teamwork.
        3. **Update Task** - Update an existing task in Teamwork.
        4. **Delete Task** - Delete an existing task and its subtasks in Teamwork.
        5. **Get Task** - Retrieve all tasks in Teamwork.
      </Accordion>

      <Accordion title="People">
        6. **List People** - Get all people records in Teamwork.
        7. **Update People** - Add or update people in a project in Teamwork.
      </Accordion>

      <Accordion title="User">
        8. **Get Current User** - Get the current user in Teamwork.
      </Accordion>

      <Accordion title="Others">
        9. **HTTP Request** - Make HTTP API calls to any Teamwork documented REST APIs.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Triggers">
    1. **Task Created** - Triggers when a task is created on Teamwork.
    2. **Project Completed** - Triggers when a project is completed in Teamwork.
  </Tab>
</Tabs>
