# Freshsales

### Snapshot

| Features                        | Details                                          |
| ------------------------------- | ------------------------------------------------ |
| Release Status                  | Released                                         |
| Source API Version              |                                                  |
| Table Selection                 | Yes                                              |
| Column Selection                | Yes                                              |
| Edit Integration                | Yes                                              |
| Replication Type Selection      | No                                               |
| Authentication Parameters       | <p>Freshsales Subdomain<br>API Key</p>           |
| Replication Type                | <p>Full Replication<br>Key Based Replication</p> |
| Replication Key                 | Date                                             |
| Suggested Replication Frequency | 24 hrs                                           |

| Tables/APIs Supported |                 |
| --------------------- | --------------- |
| Leads                 | Contacts        |
| Accounts              | Appointments    |
| Deals                 | SalesActivities |
| Tasks                 |                 |

### Pre-requisites

1. Generate Freshsales API Key for Daton
2. Read more on Where to find Freshsales API Keys [here](https://docs.sarasanalytics.com/source-api-keys/freshsales-api-keys)

### Integrate FreshSales with Daton

1. Signin to Daton&#x20;
2. Select FreshSales from Integrations page
3. Provide Integration Name, Replication Frequency, and History. Integration name would be used in creating tables for the integration and cannot be changed later&#x20;
4. Provide FreshSales Subdomain and API Key to authorize Daton to periodically extract data from FreshSales
5. Post successful authentication, you will be prompted to choose from the list of available tables
6. Then select all required fields for each table
7. Submit the integration

### Workflow

1. Integrations would be in Pending state initially and will be moved to Active state as soon as the first job loads data successfully on to the configured warehouse
2. Users would be able to edit/pause/re-activate/delete integration anytime
3. Users can view job status and process logs from the integration details page by clicking on the integration name from the active list

### FreshSales Data

**Leads**

Purpose: A lead is a prospect who has expressed interest in your product by signing up for a trial or subscribing to your newsletter etc.

Source API Documentation  <https://www.freshsales.io/api/#leads>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name             | Target Datatype |
| ---------------- | --------------- |
| id               | INTEGER         |
| first\_name      | STRING          |
| last\_name       | STRING          |
| job\_title       | STRING          |
| department       | STRING          |
| email            | STRING          |
| work\_number     | STRING          |
| mobile\_number   | STRING          |
| address          | STRING          |
| city             | STRING          |
| state            | STRING          |
| zipcode          | STRING          |
| country          | STRING          |
| lead\_stage\_id  | INTEGER         |
| lead\_reason\_id | INTEGER         |
| lead\_source\_id | INTEGER         |
| owner\_id        | INTEGER         |
| has\_authority   | BOOLEAN         |
| do\_not\_disturb | BOOLEAN         |
| medium           | STRING          |
| campaign\_id     | INTEGER         |
| keyword          | STRING          |
| facebook         | STRING          |
| twitter          | STRING          |
| linkedin         | STRING          |
| territory\_id    | INTEGER         |
| company          | RECORD          |
| links            | RECORD          |

**Contacts**

Purpose: Contacts represent the companies (Accounts) that you do business with

Source API Documentation  <https://www.freshsales.io/api/#contacts>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name                                   | Target Datatype |
| -------------------------------------- | --------------- |
| work\_number                           | STRING          |
| mobile\_number                         | STRING          |
| address                                | STRING          |
| last\_seen                             | STRING          |
| lead\_score                            | INTEGER         |
| lead\_quality                          | STRING          |
| last\_contacted                        | STRING          |
| open\_deals\_amount                    | STRING          |
| won\_deals\_amount                     | STRING          |
| links                                  | RECORD          |
| last\_contacted\_sales\_activity\_mode | STRING          |
| created\_at                            | STRING          |
| updated\_at                            | STRING          |
| keyword                                | STRING          |
| medium                                 | STRING          |
| email\_status                          | STRING          |
| last\_contacted\_mode                  | STRING          |
| recent\_note                           | STRING          |
| last\_contacted\_via\_chat             | STRING          |
| won\_deals\_count                      | INTEGER         |
| last\_contacted\_via\_sales\_activity  | STRING          |
| completed\_sales\_sequences            | STRING          |
| active\_sales\_sequences               | STRING          |
| web\_form\_ids                         | STRING          |
| open\_deals\_count                     | STRING          |
| last\_assigned\_at                     | STRING          |
| facebook                               | STRING          |
| twitter                                | STRING          |
| linkedin                               | STRING          |

**Accounts**

Purpose: Companies with whom you have an existing business relationship are saved as Accounts in Freshsales. Usually one or more individuals (contacts) are associated to the account with whom you pursue sales opportunities

Source API Documentation  <https://www.freshsales.io/api/#accounts>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name                       | Target Datatype |
| -------------------------- | --------------- |
| id                         | INTEGER         |
| name                       | STRING          |
| address                    | STRING          |
| city                       | STRING          |
| state                      | STRING          |
| zipcode                    | STRING          |
| country                    | STRING          |
| industry\_type\_id         | INTEGER         |
| business\_type\_id         | INTEGER         |
| number\_of\_employees      | INTEGER         |
| annual\_revenue            | NUMERIC         |
| website                    | INTEGER         |
| phone                      | STRING          |
| owner\_id                  | INTEGER         |
| facebook                   | STRING          |
| twitter                    | STRING          |
| linkedin                   | STRING          |
| territory\_id              | INTEGER         |
| created\_at                | STRING          |
| updated\_at                | STRING          |
| parent\_sales\_account\_id | INTEGER         |
| custom\_field              | STRING          |

**Appointments**

Purpose: Appointments are great way to meet with your prospects as attendees of appointments get notified about the time, venue and purpose of the meeting automaticaly

Source API Documentation  <https://www.freshsales.io/api/#appointments>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name                               | Target Datatype |
| ---------------------------------- | --------------- |
| id                                 | INTEGER         |
| from\_date                         | STRING          |
| end\_date                          | STRING          |
| time\_zone                         | STRING          |
| title                              | STRING          |
| description                        | STRING          |
| creater\_id                        | STRING          |
| targetable\_id                     | INTEGER         |
| targetable\_type                   | STRING          |
| location                           | STRING          |
| created\_at                        | STRING          |
| updated\_at                        | STRING          |
| is\_allday                         | BOOLEAN         |
| owner\_id                          | INTEGER         |
| appointment\_attendees\_attributes | STRING          |
| outcome\_id                        | INTEGER         |

**Deals**

Purpose: Deals are the expected sales opportunities from an account

Source API Documentation  <https://www.freshsales.io/api/#deals>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name                      | Target Datatype |
| ------------------------- | --------------- |
| id                        | INTEGER         |
| name                      | STRING          |
| amount                    | NUMERIC         |
| sales\_account\_id        | NUMERIC         |
| deal\_stage\_id           | INTEGER         |
| deal\_reason\_id          | INTEGER         |
| deal\_type\_id            | INTEGER         |
| owner\_id                 | INTEGER         |
| expected\_close           | STRING          |
| closed\_date              | STRING          |
| lead\_source\_id          | INTEGER         |
| campaign\_id              | INTEGER         |
| deal\_product\_id         | INTEGER         |
| deal\_payment\_status\_id | INTEGER         |
| probability               | NUMERIC         |
| created\_at               | STRING          |
| updated\_at               | STRING          |
| territory\_id             | INTEGER         |
| deal\_pipeline\_id        | INTEGER         |
| custom\_field             | STRING          |

**SalesActivities**

Purpose: Sales activities are a great way to track activities related to a lead/contact/deal/account. This comes in handy to get to know an entity's lifecycle

Source API Documentation  <https://www.freshsales.io/api/#sales-activities>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name                         | Target Datatype |
| ---------------------------- | --------------- |
| id                           | INTEGER         |
| title                        | STRING          |
| sales\_activity\_type\_id    | INTEGER         |
| sales\_activity\_outcome\_id | INTEGER         |
| start\_date                  | STRING          |
| end\_date                    | STRING          |
| notes                        | STRING          |
| owner\_id                    | INTEGER         |
| targetable\_id               | INTEGER         |
| targetable\_type             | INTEGER         |
| creater\_id                  | INTEGER         |
| created\_at                  | STRING          |
| updated\_at                  | INTEGER         |

**Tasks**

Purpose: Sales activities are a great way to track activities related to a lead/contact/deal/account. This comes in handy to get to know an entity's lifecycle

Source API Documentation  <https://www.freshsales.io/api/#tasks>

Replication: Key-Based Replication

Replication Key: created\_at

**Fields**

| Name             | Target Datatype |
| ---------------- | --------------- |
| type             | INTEGER         |
| title            | STRING          |
| description      | STRING          |
| due\_date        | STRING          |
| targetable\_id   | INTEGER         |
| targetable\_type | STRING          |
| owner\_id        | INTEGER         |
| status           | BOOLEAN         |
| creater\_id      | STRING          |
| created\_at      | STRING          |
| updated\_at      | STRING          |
| outcome\_id      | INTEGER         |
| task\_type\_id   | INTEGER         |
