# How to connect to the Officient API

This guide will help you set up your Officient OAuth app to connect with Apideck and start using the HRIS API.

## Prerequisites

Before you begin, make sure you have:

- An Officient account with developer access
- Access to the Apideck Dashboard

## Enable the Officient connector in Apideck

1. Navigate to the [Apideck Dashboard](https://platform.apideck.com)
2. Go to **Configuration** > **HRIS** > **Officient**
3. Click **Enable** to activate the Officient connector

## Getting Credentials

### Create the OAuth application

### Access Developer Settings

- Sign in to your Officient account
- Click on your account icon in the top right corner
- Navigate to **Developers**

  ![Officient Developer Settings](https://res.cloudinary.com/apideck/image/upload/v1762870812/docs/connectors/officient/developer-officient.png)

### Register a new app

- Click **Register a new app** to create your OAuth application

  ![Register New App](https://res.cloudinary.com/apideck/image/upload/v1762870813/docs/connectors/officient/register-new-app.png)

### Configure app details

- Enter a descriptive **App Name** for your application

  ![Add App Name](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/add-name.png)

### Get your OAuth credentials

- After creating the app, copy the **Client ID** and **Client Secret** 

  ![Copy OAuth Credentials](https://res.cloudinary.com/apideck/image/upload/v1762870812/docs/connectors/officient/copy-oauth-credentials-officient.png)


### Configure redirect URI

- Click **Edit** on your app
- Under **Basic Info**, add the redirect URI: `https://unify.apideck.com/vault/callback`
- Save your changes

  ![Add Redirect URI](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/add-redirect-uri.png)

### Configure permissions

- Navigate to the **Permissions** section
- Enable the scopes you need for your integration:
  - **Read access**: Required to retrieve data from Officient
  - **Write access**: Required if you need to perform write operations (create, update, delete)

**💡 TIP**: If you only need to read data, select Read access. If you need to create or update records, also select Write access.

  ![Configure Permissions](https://res.cloudinary.com/apideck/image/upload/v1762870813/docs/connectors/officient/setup-permissions.png)

- Save your changes

## Configure in Apideck

1. Navigate to the Officient connector configuration in the **Apideck Dashboard**
2. Select **Use your client credentials**
3. Enter the following OAuth credentials:
   - **Client ID** > `client_id`: Paste the Client ID from your Officient app
   - **Client Secret** > `client_secret`: Paste the Client Secret from your Officient app
4. Click **Save settings** to save your credentials

  ![Add Credentials in Dashboard](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/add-oauth-credentials.png)

## Test Connection

1. Connect through [Vault](https://platform.apideck.com/vault)
2. Click on **Test Vault** at the top right corner
3. Click **Authorize** to grant access to your Officient account

   ![Authorize Connection](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/authorize-connection.png)

4. Once authorized, the connection status will change to **Connected**

   ![Connection Authorized](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/connection-authorized.png)

### Do your first API call to the HRIS API

Test your connection with this call:

```bash
curl --location 'https://unify.apideck.com/hris/employees' \
 --header 'x-apideck-consumer-id: test-consumer' \
 --header 'x-apideck-app-id: {APIDECK_APP_ID}' \
 --header 'x-apideck-service-id: officient-io' \
 --header 'Authorization: Bearer {APIDECK_API_KEY}'
```

Your Officient OAuth credentials are now configured and ready to use! 🎉

## Set up webhooks

If you want to receive real-time updates from Officient, you can configure webhooks:

### Configure webhook in Officient

1. In the Apideck Dashboard, go to the Officient connector configuration
2. Navigate to the **Webhooks** section
3. Copy the **Execute URL** (webhook delivery URL)

   ![Setup Webhooks](https://res.cloudinary.com/apideck/image/upload/v1762870813/docs/connectors/officient/setup-webhooks.png)

4. In Officient, go to **Settings** > **Advanced Settings** > **Webhooks**
![Setup Officient](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/add-webhooks-officient.png)

5. Click **Add new webhook**
6. Paste the Execute URL in the **Delivery** field
7. Select the **Event Type** you want to subscribe to

   ![Add Webhook URL and Event](https://res.cloudinary.com/apideck/image/upload/v1762870811/docs/connectors/officient/add-url-select-event.png)

**💡 TIP**: Officient allows you to select only one event type per webhook. If you need to receive multiple event types (e.g., `employee.created`, `employee.updated`, `employee.terminated`), you'll need to create separate webhooks in Officient for each event type, all pointing to the same Execute URL.


### Configure webhook in Apideck Dashboard

1. Return to the Apideck Dashboard
2. Navigate to **Webhooks** > **Add webhook**
3. Enter your **Delivery URL** (the endpoint where you want to receive webhook events)
4. Select the employee events you want to receive from the dropdown:
   - `employee.created`
   - `employee.updated`
   - `employee.terminated`

   ![Create Webhook in Dashboard](https://res.cloudinary.com/apideck/image/upload/v1762871195/docs/connectors/officient/create-webhooks-dashboard.png)

5. Save your webhook configuration

Your webhooks are now configured and will deliver events from Officient to your specified endpoint when the selected events occur.

