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

To setup your Constant Contact app in Refold for OAuth, you will need the following credentials from your [Constant Contact Developer Account](https://developer.constantcontact.com/):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Constant Contact Developer Account. You can create one [here](https://www.constantcontact.com/smb/signup).

### Required Settings

* **Mandatory Scopes**

1. offline\_access
2. account\_read

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

### Creating an app in Constant Contact

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

1. Log in to your [Constant Contact Developer Account](https://developer.constantcontact.com/).
2. Click on **My Applications** in the top nav bar and click on `New Application`.

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

3. Enter the `App Name`, Select **OAuth2 flow** as `Authorization Code Flow and Implicit Flow`, **Refresh Token Type** as `Rotating Refresh Tokens` and click `Create`.

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

5. Go to **Details** section of your OAuth app > Click pencil icon to edit in `Redirect URI` > paste the Callback Url > Click `Confirm`. Click `Save` in the top right.

6. Copy the **Client ID** from **App Details** section. Click `Generate Client Secret` and copy the **Client Secret** displayed.
   <Info> Copy the Client Secret as it will be showed only once.</Info>

<img height="200" src="https://mintcdn.com/cobalt-55/qu02QklkWCst59D2/images/Constant/constant_credentials.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=5c75fa5aa8755a568547a7a15c6d5857" alt="Getting Credentials" data-path="images/Constant/constant_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/qu02QklkWCst59D2/images/Constant/constant_cobalt.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=af0eac1c557140e4293ed541c810ec18" alt="Setting up application client credentials" data-path="images/Constant/constant_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/qu02QklkWCst59D2/images/Constant/constant_scopes.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=c617bda8bd9275a3f9c76fc9128c6cfb" alt="OAuth Scopes" data-path="images/Constant/constant_scopes.png" />

Once the scopes has been added to the application in Refold, the app will now request for access of the mentioned scopes.

<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.
</Warning>

#### Actions and triggers

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

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Contacts">
        1. **Create Contact** - Create new contact in Constant Contact.
        2. **Update Contact** - Update a contact in Constant Contact.
        3. **Delete Contact** - Delete a contact in Constant Contact.
      </Accordion>

      <Accordion title="Email Campaign">
        4. **Get Campaign by ID** - Get email campaign by ID in Constant Contact.
        5. **Create Campaign** - Create a new email campaign in Constant Contact.
        6. **List Email Campaigns** - Get a collection of email campaigns in Constant Contact.
      </Accordion>

      <Accordion title="Contact List">
        7. **Remove Contact from List** - Remove a contact from list in Constant Contact.
        8. **Add Contact to List** - Add contact to list in Constant Contact.
      </Accordion>

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

  <Tab title="Triggers">
    No triggers available for this application.
  </Tab>
</Tabs>
