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

To setup your Zoho Recruit app in Refold for OAuth, you will need the following credentials from your [Zoho Developer Console](https://api-console.zoho.com/):

* Client ID
* Client Secret

## Pre-requisites

1. Zoho Developer Console. You can create one [here](https://accounts.zoho.com/register).

## Required Settings

* **Mandatory Scopes**

1. ZohoRecruit.users.READ

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

## Creating an app in Zoho Recruit

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

1. Log in to your [Zoho Developer Console](https://api-console.zoho.com/).
2. Click on the `+ Add Client` button in the right and select `Server-based Applications` button.

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

3. Enter the **Client Name** for your application and add a **Homepage URL**.
4. Go to your [`Apps catalog`](https://app.gocobalt.io/apps) in **Refold** > Search for `Zoho Recruit` > `Settings` > `Callback Url` > Copy it.
5. Paste the Callback URL under `Authorized Redirect URIs` and click on the `Create` button.

<img height="200" src="https://mintcdn.com/cobalt-55/PicQQg0XJq1JrBVB/images/Zohocrm/Zohocrm_config.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=2ef00994e6040b6a0309dbe0d8dad043" alt="Setting up Zoho Recruit Developer app" data-path="images/Zohocrm/Zohocrm_config.png" />

6. Navigate to the `Client Secret` tab in the app and copy the **Client ID** and **Client Secret**.

<img height="200" src="https://mintcdn.com/cobalt-55/PicQQg0XJq1JrBVB/images/Zohocrm/Zohocrm_credentials.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=f7521bc8ee5c108d31c845cd5bccb935" alt="Getting Credentials" data-path="images/Zohocrm/Zohocrm_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/PicQQg0XJq1JrBVB/images/Zoho_recruit/ZohoRecruit_cobalt.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=198472f14ee6d5aa899d5637d8354744" alt="Setting up application client credentials" data-path="images/Zoho_recruit/ZohoRecruit_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/PicQQg0XJq1JrBVB/images/Zoho_recruit/ZohoRecruit_scopes.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=43afd6cad0ef9f2189054a8a9058a42e" alt="OAuth Scopes" data-path="images/Zoho_recruit/ZohoRecruit_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>

## Zoho Recruit Single Webhook URL

If you wish to create an orchestration where a workflow is being triggered when some operation occurs in Zoho Recruit, you'd need to create a Zoho Recruit's Webhook and add it as a Rule.

Refold provides a single webhook URL to manage such event triggers. The steps given below needs to be followed by all of your customers to setup webhooks in their account.

Let's setup the **Candidate Status changed** webhook in Zoho Recruit. For this you need to do two steps:

#### 1. Create Webhook Action

1. Select **Zoho Recruit** from the application list in **Refold** > select `Settings` and copy the `Single Webhook URL`.
2. In Zoho Recruit, click on `Setup`(Gear icon) in the top bar and select `Actions` present under **Automation**.

<Note>
  Your customers' accounts should be on Zoho Recruit Standard or a higher plan to use webhooks.
</Note>

<img height="200" src="https://mintcdn.com/cobalt-55/PicQQg0XJq1JrBVB/images/Zoho_recruit/Zohorecruit_webhook.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=579bd2affda21e9dfa67604dbcc38281" alt="Setting up Zoho Recruit Webhook Action" data-path="images/Zoho_recruit/Zohorecruit_webhook.png" />

3. Switch to the `Webhooks` tab and click on `Configure Webhook`.
4. Provide a **Name** > Paste the `Single Webhook URL` that you copied under **URL to Notify** and select the **Module** as `Candidates`.
5. Under `Append Entity Parameters`, go to **Parameters in the User Defined Format**, give the `Parameter Name` as **data** and copy the JSON provided below in `Value Description` field.

<CodeGroup>
  ```javascript candidate_stage_changed theme={null}
  {
    "candidate_id": "${Candidates.Candidate Id}",
    "owner_id": "${Candidates.ownerId}",
    "associated_tags": "${Candidates.Associated Tags}",
    "candidate_stage": "${Candidates.Candidate Stage}",
    "candidate_status": "${Candidates.Candidate Status}",
    "city": "${Candidates.City}",
    "country": "${Candidates.Country}",
    "created_by": "${Candidates.Created By}",
    "current_employer": "${Candidates.Current Employer}",
    "current_job_title": "${Candidates.Current Job Title}",
    "current_salary": "${Candidates.Current Salary}",
    "email": "${Candidates.Email}",
    "email_opt_out": "${Candidates.Email Opt Out}",
    "expected_salary": "${Candidates.Expected Salary}",
    "experience_in_years": "${Candidates.Experience in Years}",
    "first_name": "${Candidates.First Name}",
    "fresh_candidate": "${Candidates.Fresh Candidate}",
    "highest_qualification_held": "${Candidates.Highest Qualification Held}",
    "is_unqualified": "${Candidates.Is Unqualified}",
    "last_name": "${Candidates.Last Name}",
    "linkedin": "${Candidates.LinkedIn}",
    "mobile": "${Candidates.Mobile}",
    "phone": "${Candidates.Phone}",
    "postal_code": "${Candidates.Postal Code}",
    "rating": "${Candidates.Rating}",
    "salutation": "${Candidates.Salutation}",
    "skill_set": "${Candidates.Skill Set}",
    "street": "${Candidates.Street}",
    "website": "${Candidates.Website}"
  }
  ```

  ```javascript candidate_created theme={null}
  {
    "candidate_id": "${Candidates.Candidate Id}",
    "owner_id": "${Candidates.ownerId}",
    "associated_tags": "${Candidates.Associated Tags}",
    "candidate_stage": "${Candidates.Candidate Stage}",
    "candidate_status": "${Candidates.Candidate Status}",
    "city": "${Candidates.City}",
    "country": "${Candidates.Country}",
    "created_by": "${Candidates.Created By}",
    "current_employer": "${Candidates.Current Employer}",
    "current_job_title": "${Candidates.Current Job Title}",
    "current_salary": "${Candidates.Current Salary}",
    "email": "${Candidates.Email}",
    "email_opt_out": "${Candidates.Email Opt Out}",
    "expected_salary": "${Candidates.Expected Salary}",
    "experience_in_years": "${Candidates.Experience in Years}",
    "first_name": "${Candidates.First Name}",
    "fresh_candidate": "${Candidates.Fresh Candidate}",
    "highest_qualification_held": "${Candidates.Highest Qualification Held}",
    "is_unqualified": "${Candidates.Is Unqualified}",
    "last_name": "${Candidates.Last Name}",
    "linkedin": "${Candidates.LinkedIn}",
    "mobile": "${Candidates.Mobile}",
    "phone": "${Candidates.Phone}",
    "postal_code": "${Candidates.Postal Code}",
    "rating": "${Candidates.Rating}",
    "salutation": "${Candidates.Salutation}",
    "skill_set": "${Candidates.Skill Set}",
    "street": "${Candidates.Street}",
    "website": "${Candidates.Website}"
  }
  ```
</CodeGroup>

5. Under `Append Custom Parameters`, you need to add two parameters:

* First parameter name is `event` whose value will be `candidate_stage_changed`.
  <Info>The value of event will change based on the trigger that you are trying to setup.</Info>
* Second parameter name is `identifier` whose value will be the email id of Zoho Recruit account that is being used.

<img height="200" src="https://mintcdn.com/cobalt-55/PicQQg0XJq1JrBVB/images/Zoho_recruit/Zohorecruit_action.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=b90134d01c8477ffac928fa43c963ac1" alt="Set up Zoho Recruit Action" data-path="images/Zoho_recruit/Zohorecruit_action.png" />

6. Click on `Save` to add the webhook.

#### 2. Create Workflow Rule in Zoho Recruit

Once the user has created a webhook, they now need to add it as a Rule in Recruit so that it fires Refold event.

1. Navigate to `Workflow Rules` under **Automation** and click on `+ Create Rule` button.
2. Select **Module** as `Candidates`, add a **Rule Name** and click on `Next`.
3. In the Rule, select `On a record action` > Choose `Candidate Stage` radio button for the Candidate Status Changed trigger and click on `Next`.

<Tip>
  Based on the trigger that you are using, you would select different action. For example in Candidate Created, you would choose the `Create` radio button.
</Tip>

4. Select `All Candidates` as the **Condition 1** and click on `Next`.
5. Select `Instant Actions` and click on `Webhooks`. Select the Webhook that you created and click on `Associate`.

<img height="200" src="https://mintcdn.com/cobalt-55/PicQQg0XJq1JrBVB/images/Zoho_recruit/Zohorecruit_rule.png?fit=max&auto=format&n=PicQQg0XJq1JrBVB&q=85&s=404d6bf02887830cb07b58ead92e2e42" alt="Set up Zoho Recruit Rule with webhook" data-path="images/Zoho_recruit/Zohorecruit_rule.png" />

6. Click on `Save` and your webhook is now completely setup for use.

## Actions and triggers

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

<Tabs>
  <Tab title="Actions">
    <AccordionGroup>
      <Accordion title="Application">
        1. **List Applications** - List all applications in Zoho Recruit.
      </Accordion>

      <Accordion title="Candidate">
        2. **Create Candidate** - Create a new candidate in Zoho Recruit.
        3. **List Candidates** - List all candidates in Zoho Recruit.
        4. **Upsert Candidate** - Upsert a candidate in Zoho Recruit.
        5. **Change Candidate Status** - Change candidate status in Zoho Recruit.
        6. **Associate candidates with job openings** - Associate candidates with job openings in Zoho Recruit.
      </Accordion>

      <Accordion title="Job">
        7. **List Job Openings** - List all job openings in Zoho Recruit.
        8. **Create Job Opening** - Create a new job opening in Zoho Recruit.
        9. **Update Job Opening** - Update a job opening in Zoho Recruit.
      </Accordion>

      <Accordion title="Note">
        10. **Create Note** - Create a new note in Zoho Recruit.
        11. **List Notes** - List all notes in Zoho Recruit.
        12. **Update Note** - Update an existing note in Zoho Recruit.
      </Accordion>

      <Accordion title="Tag">
        13. **Create Tag** - Create a new tag in Zoho Recruit.
        14. **Add Tag** - Add tags to a record in Zoho Recruit.
      </Accordion>

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

  <Tab title="Triggers">
    1. **Candidate stage changed** - Triggers when a candidate stage is changed in Zoho Recruit.
    2. **Candidate created** - Triggers when a candidate is created in Zoho Recruit.
    3. **Application created** - Triggers when an application is created in Zoho Recruit.
    4. **Job opening status changed** - Triggers when a job opening status is changed in Zoho Recruit.
  </Tab>
</Tabs>
