# 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="/files/RDp09fcQKwbzLPxWKhxQ" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/SCDiWzqOutX5xN6yWa0D" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/uiFtIuOttk0aZbf5xTKR" 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="/files/DEzUt09yBDvhpEvXjqVQ" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/WDdJVBX2tnpVpPZ41TC1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/Jon7efdPI5HSbTwjavAr" 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="/files/stH2Z3nYwf4D4Ei9IE7B" 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="/files/dbZ4mSKPdRM5htVzXbWn" 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="/files/VyI38sUz7t7YKkrJxG6Q" 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="/files/sR9FNbOePaUZVXfJb90P" 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="/files/IMDimzPMfOglpzR6qTKo" 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="/files/nFq97FMBxIniENJG3fv5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/toky-en/integrationstokyapp/create-call-tasks-associated-with-leads-and-contacts-using-salesforce-lightning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
