# Create call Tasks associated with Leads and Contacts using Salesforce Lightning

To begin this process in creating call tasks using Salesforce Lighting, make sure of the following:

* The Salesforce user creating the integrations is admin or has API access rights.
* That your Salesforce Edition has the API access enabled. Read more [here](https://help.salesforce.com/articleView?id=000005140\&type=1).
* You've enabled the field Type on the Task object in Salesforce. This field is very important to mark the task as a call. To check if you are allowed, go to: *Gear icon > Setup > Object Manager > Task > Field & Relationship*

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-342e77f7c9fc9803f15a5a7f91dff0a863f7ead6%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Inside **Type** you should see something like this. If not, edit and create a new value Call:

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-d62803dc228be9e3143541bffa1e19ef5c1b25f3%2Fimage__1_.png?alt=media" alt=""><figcaption></figcaption></figure>

Last, click on **Set Field-Level Security** and make sure **Visible** is checked, as shown below:

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-bb2488ac667a0bba7eab5969a1a871aa53c11043%2Fimage__2_.png?alt=media" alt=""><figcaption></figcaption></figure>

To start the integration, first create your Consumer Key and Secret

You will need to be logged in as a System Administrator in Salesforce to access these settings.

1\. Go to **Setup**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-7b5a3465c39d695f854864e26c6dbd48f385f1ae%2Fimage__3_.png?alt=media" alt=""><figcaption></figcaption></figure>

2\. In Quick Search, type **Apps** and Click in **App Manager**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-19e0dac691ecf9db37e1edcf3013a09eba2ea703%2Fimage__4_.png?alt=media" alt=""><figcaption></figcaption></figure>

3\. In **App Manager**, click on **New Connected App**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-bcd2f19e740dbe233b67d7b2de915ab1eb75d2fe%2Fimage__5_.png?alt=media" alt=""><figcaption></figcaption></figure>

4\. Fill in the form with this data:

* **Connected App Name:** "toky\_app"
* **API Name**= toky\_app
* **Contact email**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-f86848449a23d899b752803a0fb9611f4b1f0459%2Fimage__6_.png?alt=media" alt=""><figcaption></figcaption></figure>

5\. Click the checkbox to enable OAuth settings.

* **Enter callback URL for the integration:** <https://app.toky.co/business/tools/salesforce/setup>
* Select **"Perform request on your behalf"** and click Add
* Check that **Full access** is enabled in the OAuth Scope. If not, please add it.
* Then click "**Save**"

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-ab629360bf06e43b23adf05bf85c3d5930d8fc38%2Fimage__7_.png?alt=media" alt=""><figcaption></figcaption></figure>

6\. After saving, it will take you to the newly created app information page. This page will have the Consumer Secret and Consumer Key which will be used in the [Salesforce integration page](https://app.toky.co/business/tools/salesforce) inside Toky. Please copy that information to use it in Toky.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-0a70c461addba7538c95a3d892f2df47a274b1e4%2Fimage__8_.png?alt=media" alt=""><figcaption></figcaption></figure>

7\. Before finishing, please check the OAuth Policies of the app. To check this, click on **Manage**. This should take you to a page to edit Policies

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-87103cb7f853aebd461998c00b2c1346c89e3ef2%2Fimage__9_.png?alt=media" alt=""><figcaption></figcaption></figure>

8\. Click on **Edit Policies** and check that the following values are set:

* Permitted Users: All users may self-authorize
* IP Relaxation: Relax IP restrictions.
* Refresh Token Policy: Refresh token is valid until revoked.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-2269a2bd7c9ca3fea8bbdb32236472d8d2e3346d%2Fimage__10_.png?alt=media" alt=""><figcaption></figcaption></figure>

If you've modified an item, please click Save.

9\. After saving, go to [Salesforce integration page](https://app.toky.co/business/tools/salesforce) inside Toky and enter the information required. If there are no errors, Toky will start importing Leads and Contacts, names and phone numbers, inside Toky DB. This will allow Toky to create tasks related to Leads and Contacts, and also show the contact information in Toky Dashboard.

Tasks created inside Salesforce will look something like this:\
\\

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-484eba8f00967fe92f6681f2624626b980d1bf7a%2FSF1-2.png?alt=media" alt=""><figcaption></figcaption></figure>
