> ## 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 Talkdesk app for OAuth.

To setup your Talkdesk app in Refold for OAuth, you will need the following credentials from your [Talkdesk account](https://account.talkdeskid.com/select/cc):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Talkdesk account. To create an account, you need to apply for Talkdesk Partner program [here](https://partners.talkdesk.com/English/).

### Required Settings

* **Mandatory Scopes**

1. account:read

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

### Creating an app in Talkdesk

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

1. Log in to your [Talkdesk account](https://account.talkdeskid.com/select/cc).
2. Click on the `Builder` icon in the side menu and select `OAuth Clients` option.

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

3. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Talkdesk` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.

4. Click on `New Oauth Client` button in Talkdesk platform > Provide an `OAuth Client Name` > Select all 3 options under `Grant Type` > Paste the Callback Url under `Redirect URI's`.

5. Select the **mandatory scopes** in the **Selected scopes** section, as provided in your Refold Talkdesk settings page and click on the `Add Scopes` button. Click on `Create` to complete the app creation.

<img height="200" src="https://mintcdn.com/cobalt-55/z_Cm6DgpvP5zfZT8/images/Talkdesk/talkdesk_config.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=5094048feb22c21a868a26ff6ba6d19f" alt="Setting up Pipedrive Developer app" data-path="images/Talkdesk/talkdesk_config.png" />

7. Copy the **Client ID** and **Client Secret** displayed.

<Note>
  Ensure that the Client Secret is saved as it will be shown only once.
</Note>

<img height="200" src="https://mintcdn.com/cobalt-55/z_Cm6DgpvP5zfZT8/images/Talkdesk/talkdesk_credentials.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=787855a176ac61f87d2e2500c4ad3bad" alt="Getting Credentials" data-path="images/Talkdesk/talkdesk_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/Talkdesk/talkdesk_cobalt.png?fit=max&auto=format&n=z_Cm6DgpvP5zfZT8&q=85&s=7723b7c4e4b6d38dfbd73ccbeec2cddc" alt="Setting up application client credentials" data-path="images/Talkdesk/talkdesk_cobalt.png" />

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

#### Configuring Scopes

Refold lets you configure what permissions to ask from your users while they install your application. The scopes can be added or removed from the App settings page, under `Permissions & Scopes`
section.

For some applications Refold sets **mandatory scopes** which cannot be removed. Additional scopes can be selected from the drop down. Refold also has the provision to add any
custom scopes supported by the respective platform.

<img height="200" src="https://mintlify.s3.us-west-1.amazonaws.com/cobalt-55/images/Talkdesk/talkdesk_scopes.png" alt="OAuth Scopes" />

Once the scopes has been added to the application in Refold, go to your [Talkdesk account](https://account.talkdeskid.com/select/cc) and update the scopes as added on Refold.

Select the OAuth App created for Refold > Click on `Add scopes` > Add the scopes as added in Refold > Click on `Add Scopes` and then `Save Changes`.

<Warning>
  If you are facing scopes missing or invalid scope error. Make sure you are not passing any custom scope not supported by the platform. And, the scopes selected here are
  identical to the ones selected in the platform.
</Warning>

#### Actions and triggers

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

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Campaigns">
        1. **List Campaigns** - List all campaigns in Talkdesk.
      </Accordion>

      <Accordion title="Cases">
        2. **List Cases** - Get all cases in Talkdesk.
      </Accordion>

      <Accordion title="Contacts">
        3. **List Contacts** - Get all the contacts in Talkdesk.
        4. **Get Contact By Id** - Get contact By Id in Talkdesk.
        5. **Delete Contact** - Delete a contact in Talkdesk.
      </Accordion>

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

  <Tab title="Triggers">
    There are no triggers in this application.
  </Tab>
</Tabs>
