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

To setup your Contentful app in Refold for OAuth, you will need the following credentials from your [Contentful Developer account](https://app.contentful.com/account/profile/developers/applications):

* Client ID
* Client Secret
* Scopes

### Pre-requisites

1. Contentful Developer account. You can create one [here](https://www.contentful.com/sign-up/).

### Required Settings

* **Mandatory Scopes**

1. content\_management\_manage

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

### Creating an app in Contentful

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

1. Log in to your [Contentful Developer account](https://app.contentful.com/account/profile/developers/applications).
2. Click on your **Profile** in the top right corner, select `Account Settings` and switch to `OAuth applications` tab.

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

3. Click on `New Application` button and provide a **Name** and **Description** of the app.
4. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Contenful` > `Settings` > `Use your credentials` > `Callback Url` > Copy it.
5. Paste the copied Callback Url in the `Redirect URI` field of the app creation form.
6. Select `Content management manage` and `Confidential` checkbox and click on the `Create Application` button.

<img height="200" src="https://mintcdn.com/cobalt-55/qu02QklkWCst59D2/images/Contentful/contentful_config.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=6df15195f877c6b2948ccc7efdef65d1" alt="Setting up Developer app" data-path="images/Contentful/contentful_config.png" />

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

<img height="200" src="https://mintcdn.com/cobalt-55/qu02QklkWCst59D2/images/Contentful/contentful_credentials.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=3c8455ae7f802701313fbc458c3e6504" alt="Getting Credentials" data-path="images/Contentful/contentful_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/Contentful/contentful_cobalt.png?fit=max&auto=format&n=qu02QklkWCst59D2&q=85&s=bd25e19b5c03ecb15344ff429fd1edc4" alt="Setting up application client credentials" data-path="images/Contentful/contentful_cobalt.png" />

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

#### Actions and triggers

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

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Assets">
        1. **Get Assets** - Get all assets in Contentful.
        2. **Create Asset** - Create a new asset in Contentful.
        3. **Update Asset** - Update an asset in Contentful.
      </Accordion>

      <Accordion title="Environment Template">
        4. **Create Environment Template** - Create new Environment Template in Contentful.
        5. **Update Environment Template** - Update Environment Template in Contentful.
      </Accordion>

      <Accordion title="Files">
        6. **Upload File** - Upload a Binary File in Contentful.
      </Accordion>

      <Accordion title="Spaces">
        7. **Get Spaces** - List all space in Contentful.
        8. **Create Space** - Create a new space in Contentful.
      </Accordion>

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

  <Tab title="Triggers">
    1. **Asset created** - Triggers when a new asset is created on Contentful.
    2. **Content Type Published** - Triggers when any content is published on Contentful.
  </Tab>
</Tabs>
