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

To setup your Intercom app in Refold for OAuth, you will need the following credentials from your [Intercom Developer Hub](https://developers.intercom.com/):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Intercom Developer Hub account.

### Required Settings

* **Mandatory Scopes**

1. Read admins

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

### Creating an app in Intercom

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

1. Log in to your [Intercom Developer Hub](https://developers.intercom.com/).
2. Click on the `Your Apps` option in the top navbar.

<img height="200" src="https://mintcdn.com/cobalt-55/lcADCqUGrbz-iIZQ/images/Intercom/intercom_navigation.png?fit=max&auto=format&n=lcADCqUGrbz-iIZQ&q=85&s=9de8e473f66b91f0e4c4b1c137df472e" alt="Navigation for App setup" data-path="images/Intercom/intercom_navigation.png" />

3. Click on `New app` button, give the `App Name`, select the `Workspace` and click on the `Create App` button.
4. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Intercom` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.
5. Navigate to `Authentication` under `Configure` in the side menu > click on `Edit` in the right > Tick the `Use OAuth` option > Click on `+ Add redirect URL` > Paste the Callback Url.
6. In the same page, select the **mandatory scopes** in the **Permissions** section and click on the `Save` button.

<img height="200" src="https://mintcdn.com/cobalt-55/lcADCqUGrbz-iIZQ/images/Intercom/intercom_config.png?fit=max&auto=format&n=lcADCqUGrbz-iIZQ&q=85&s=ed46d3307c280428c697aaf4551fd906" alt="Setting up Intercom Developer app" data-path="images/Intercom/intercom_config.png" />

<Note>
  To access your customer's Intercom data using OAuth, you will need to submit your app for review and make it a public-facing integration. Learn more about App publishing [here](https://developers.intercom.com/docs/publish-to-the-app-store/listing-your-app/).
</Note>

7. Navigate to the **Basic information** option in the side menu and copy the **Client ID** and **Client Secret** displayed.

<img height="200" src="https://mintcdn.com/cobalt-55/lcADCqUGrbz-iIZQ/images/Intercom/intercom_credentials.png?fit=max&auto=format&n=lcADCqUGrbz-iIZQ&q=85&s=4073e5634b76fc28e65cb8d29b6b2935" alt="Getting Credentials" data-path="images/Intercom/intercom_credentials.png" />

#### Configuring credentials in Refold

App settings page lets you configure the authentication settings for an `OAuth2` 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/lcADCqUGrbz-iIZQ/images/Intercom/intercom_cobalt.png?fit=max&auto=format&n=lcADCqUGrbz-iIZQ&q=85&s=b5c89fca3989aed513ab326fd250fd10" alt="Setting up application client credentials" data-path="images/Intercom/intercom_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://mintcdn.com/cobalt-55/lcADCqUGrbz-iIZQ/images/Intercom/intercom_scopes.png?fit=max&auto=format&n=lcADCqUGrbz-iIZQ&q=85&s=a0e1ba564acfb5902e4c6af402b2d15f" alt="OAuth Scopes" data-path="images/Intercom/intercom_scopes.png" />

Once the scopes has been added to the application in Refold, go to your [Intercom Developer Hub](https://developers.intercom.com/) and update the scopes as added on Refold.

Select the OAuth App created for Refold > Click on `Authentication` under **Configure** > Click on `Edit` > Add the scopes as added in Refold > Click on `Save`.

<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 Intercom actions and triggers. Following are the set of Intercom actions and triggers
supported by Refold.

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Companies">
        1. **List Companies** - Get all companies in Intercom.
        2. **Create Company** - Creates a company in Intercom.
        3. **Update Company** - Updates a company in Intercom.
      </Accordion>

      <Accordion title="Conversations">
        4. **List Conversations** - Gets a list of conversations in Intercom.
        5. **Create Conversation** - Creates a conversation in Intercom.
        6. **Update Conversation** - Updates a conversation in Intercom.
        7. **Reply Conversation** - Replies to a conversation in Intercom.
      </Accordion>

      <Accordion title="Tags">
        8. **List Tags** - Gets a list of tags in Intercom.
        9. **Create Tag** - Creates a tag in Intercom.
        10. **Add Tag to Ticket** - Add tag to a ticket in Intercom.
      </Accordion>

      <Accordion title="Tickets">
        11. **Create Ticket** - Creates a ticket in Intercom.
        12. **Update Ticket** - Updates a ticket in Intercom.
        13. **Search Ticket** - Searches a ticket based on the search parameter in Intercom.
      </Accordion>

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

  <Tab title="Triggers">
    1. **Ticket Created** - Triggers when a ticket is created on Intercom.
    2. **Ticket State Updated** - Triggers when a ticket state is updated on Intercom.
    3. **Conversation Priority Updated** - Triggers when a conversation priority is updated on Intercom.
  </Tab>
</Tabs>
