# Salesforce

The Salesforce integration is an integration process that requires several setup steps in Salesforce before any connection or configuration in Dapta. These steps go as follows:

\
**Open Setup**

Open your Salesforce account and go to the settings configuration on the top right with the tool icon.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeEKKaY_amwW9_rrXe5B8NuTCINQQGP8irJ-sgukAvEOm2GZFAV3WubOVf_fp0cpzl5CdhGI64Eivm80Xqa-UuBd60wI-FgeMVt7q2gfFUJ3E0monvonk3080w95htZyr74gT4r_w?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

**Application setup**

Go to “Platform tools” and to the section called “App management” if you have this in English or “Gestor de aplicación” in Spanish

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdClkge01E5CYNSgMqg3zluUWb78iD_kbXOYUAQazJJ-VFDHRnAaL2CyDl4HcdSgBJX8XcKpiC4BP6FcIsGRLmg10xtFTvfGO1CsqtT2ikiE9aQLVYtKQrXLuE4KuCzlOe9XcZM?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

**New application**

Click on create new application. It’ very important that if you get two options for the creation, you go with “New connected app” and then with “Create a connected application”

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeH8PZg2Kg21mE0z0s3He2DhtRVe78mcdSJIPdJxgf9VxaJ25MkLRc6WRZJr59MYR93dw0InGxvuThVuXEkBN0dAAJZloHn5VjR1nAVqrVcO7rIa9XcEjnvqLWunQqw-1C-XJCb?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf2cjgpneRV1Px5pFnU6deqh7efmZ61HHZMLc_veKNHOXw7Te_BKsTV8h-M4rc0N1v9y0UXZVH_odYI_X3BJhtIwDKK1BAG4GjuUg7jW5DDlwyNP8cg7HDCCzoacse2tb0WvvlnVA?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

\
**Dapta URL**

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfRCIsGhaHvuiGCBe4e8i41yUB_xXZWo1Tqh556vZaMHY1b1DleZHa8EeO1zq2QsHbcYY_1LcSVEJvopgU1o9qixz4-jGhj07JLe6YCsy8ICWnRBZCiVT5o-HWjnVuhPrxhuMkuVw?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

Once you’re on this screen, make sure you fill out with the Dapta required information.

For the name, you can go with anything that helps you identify the app. Something like “Dapta conector” is recommended. Ad for the email you can set your own so that you can get any inconsistency emails from Salesforce

\
**Permission set**

Once you have set that up, go ahead an check the permissions that are needed. For this type of integration, it’s really important to set the permissions to set the permissions to “Full access” so that we can perform READ AND WRITE operations via the Salesforce API.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdIcR1rbqReUpA5qYCmgc4DpnBIBckXSOPmE4c2cYU1qqUAjzVYjTF_j6ThUWPntPK89oleIAtqP0ol0Maewj0cTBS8YQ55nlbllcPgKnHzuZUXLGDGehL3RU6siChtUIKXhZRdjA?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdIaU9E4l4hZUUl3jfW9tEFdPukNVGG6ICYwtp4QFWfN0t1HYtz_3uZzQOf43A8xk8Rk0qdmEuIH3h1sr7XW5oFRvnZNuvfzMJrR9TuuaZxm2ven_Zu-EMgPX2CofdAtew8368fZQ?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

It’s also important to check the options for “Activate the OAuth configuration”, “Require secret” for both web server and token update. And also require key for “PKCE”

The final step for this is checking these four options:<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfU1d1KOur-QAA-WfF-ESB_ry3oOvwb_qGZPwTHf-fb1s-YhTV24U0PaFbIkUxoFv9f6ma_FezHyC-xIkzw9SLi-aozrOXdFtugtyWl5kyglZ1m6FU3YYujBtE-wx7zcbDTwBzCyw?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

These options are “Activate the client credential flow”, “Activate the flow for authorization and credentials”, “Require user credentials at the POST body for the authorization and credential flow” and “Emit access token based on JSON web tokens “JWT” for named users. These will allow us to connect via the Salesforce API. Once you hit on save, this will create the application

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdx7sIgOgXvTxtYNUm5wWFhznJVluVS8c2Js24OX9QMFjzPSj9fxWsx0bG2NoXFja9_IBL-2buI4fDPrMS9BC4-FYA_k_bCDzHb65ErRKUPY0ORg5dMEaqRPa1N4fJf2ftN1UXArw?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

**Execute as admin user**

Once the app has been created you can go to the “Modify” option at the top three options and go to the “Connected app manager option”

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdx7sIgOgXvTxtYNUm5wWFhznJVluVS8c2Js24OX9QMFjzPSj9fxWsx0bG2NoXFja9_IBL-2buI4fDPrMS9BC4-FYA_k_bCDzHb65ErRKUPY0ORg5dMEaqRPa1N4fJf2ftN1UXArw?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfERUnLhcAWTxj-hy1x__pPeC7skPzEr7fb4HO53RlK6VsRc7cu2pMI9_so2ylaUK56WnNceI2ardOC5b5LUe44JR-bhQnRO8d6-ojBka_IS48QvrN2N3UYFmTjIdLJuqpHgGiW?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

<br>

**THIS IS VERY IMPORTANT.** Make sure you mark the option for “Execute as” and you TYPE YOUR USERNAME. This is not very intuitive but you have to type the user name that appears on your Salesforce account at the top right

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcBstFE7OFtsa1v3XDqKvF4YemRw6U-yME_VKOPP4Imyi4qn38zb9xxvX0oLZ7_m_OT6NHXdQjY7GwXqtHY5lzqa4lJc4v1aAf4pazAfgaNkJ82zB7A_UPVtR5SDNCe0AaX-ysEsA?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

Make sure you type it just as it appears on the platform. If you don’t complete this step, the connection will not work.

Make sure you also type your user name at the “Client credentials” flow section

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeRdwZjqbruFzlzR-TjjmgvGmsSobUSH3SkKgK3_k_Y0XlE_uYba88ev2bsx8U_8Fj1dwAWJvMenKdGEkzhTaFnrurmcGTe_JjY3__0peQRrdhsjReaQwWVYXQqBTZrQ0igHoS3?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

\
**Request the auth token**

Once the app has been created, make sure you go to “Manage” and select the option to “Manage” at the “key and consumer secret”.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf_cph8D4kMfEOBESfOAqsOWaGmJJLUhxj2E6MaRjTICTGWeQehJQpYnv0A5fPhMKOBtqUlpxJ-ryj6jv_cOl-NF6GGOCqxtQj30oROvDUnVQnwsuERH7USrZBwYfyYR83NbQzG1A?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

This will provide you with the “consumer key” and the “client secret”

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfeoPVbcoY39yktx4HQVfWofg24h6pFPZJ1PCuL1etC6CMbnqvlgV1IF0FGTTIzYeBETl53i_BHEfflUyAptWOCAw9FrJisiwVRrT7KRBOoSccWompV1N43NbYx8xYrIQN0lAjCSg?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

**Perform the API requests**

Once you have all of the information you can proceed to completing requests via Dapta.

The first thing you’re going to need is a custom API node with a POST method that requests the Salesforce token like this.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe-gJh4nUWLQWY2qs_PsFhAbZ0DlDcxGjtrajkjdELtZM7jMPdOq30t-5LUCanY0QyRL-8GJph0SlcP1cCo-Qy-6bK5atwhqG9cGO7zOI6IRkQ-Mk9K5QqJuTnESBglk2p0oRw4Lw?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

Make sure you replace “YOURCOMPANYDOMAIN” with your actual company domain and add the following body that will contain the credentials you extracted on previous steps

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfvOKVFKsoEasJ8gumNmfOgWDFEAic9uw8-7MT6FP8pATo29Qmj1tUrM_4oC8GOwUmXg3-aH0nhcp4A4zMIfGJR0jk9n7R0d84UF9l7q71ethHVYLCiN6iTt_-_Uj9H1MX4x_rvLA?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

This post method will generate a token with which you are going to be able to perform any get or post request by adding it to the header as a Bearer token.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdwOn9NfrG0-qazHWKWDQKdV4rLLNQopd4UV0BUtbdEph-EpiZx2IWY0_tsVn5PeuDH3bNMPgodQqb1PTeGutRyvzrzchKF2K9HvlLD4YLetStRNj0qHmSQh2_CxHtBYvtbRN47Og?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

**Recommendations**

Salesforce’s API allows you to do Queries based on an SQL format so if you want to search for particular information you can do so by setting the following body at the previously exemplified Endpoint

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXddA4SdKu7zUg29UkanCISGs-CtzxznHGPlk-P6enZ0uUoB6gYNFPL_l-XFbG94BJihj6nN4WgopKzCzLHtYJLZ2NF-ZE0IpRYC8iZVg6EI0KPyxwfZ18oF1HH1hePOpfHfFr7gqQ?key=8AG8a0OJqIxRz5NIjxTsvw)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdBJ8GSWHtghLsH3gQzhOdAiMPYqr66QnzeGCpuj-hDjSKBMBLngWZrb3mVu9rOr-6dtD8CRBdP808P6zn2ePd_VI4KD1hBiFtdz7EhCn5gzDMbUjEThR_wZYCnWvhmFGzI9lKuLg?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

If you want to post information, be that updating objects or creating new ones, you can use regular PATCH and POST methods with the information structure that you have on your CRM

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcBSI64Ny-8saIunRcX1vP3yqjcLncvVagXFnVhYbazAlFqnB45MXYRppbSEfHRFYCwFgHKe4399HwDv9JzvkhStb1AWF5NuF-OWU9LB0_HnjZrzqTcJOK7YWGjRbZSKeVB6aYF?key=8AG8a0OJqIxRz5NIjxTsvw" alt=""><figcaption></figcaption></figure>

<br>
