# Salesforce

{% hint style="info" %}
This integration is only available in open-source and on-premise editions. Please contact us, if you want to have Salesforce in the cloud edition for you organization.
{% endhint %}

**Integration type**:  `Write`

With Salesforce integration you can stream data and create Salesforce tickets in real-time.

If you need to stream flexible data directly to Salesforce API, consider using [API integration](/integrations/library-of-integrations/apis.md) instead.

## Configuring integration for open-source and on-premise versions using OAuth 2.0

### Step 1. Salesforce Connected App and authorizing Ylem to have access to user's account

You need to create your own Salesforce Connected App first and integrate your Ylem instance with it so that your users will be able to authorize Ylem to access their Salesforce account data.

Here you can read more about how to create a [connected APP](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm\&type=5) and manage [OAuth 2.0 authentication](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_authenticate.htm\&type=5) with Salesforce.

{% hint style="info" %}
Please note, that a Salesforce user must be assigned to the system permissions "**API Enabled**", and "**Apex REST Services**"
{% endhint %}

As soon as the application is created, you will get OAuth 2.0 `CLIENT_ID` and `CLIENT_SECRET` that must be placed into the `./backend/integrations/.env` file of Ylem together with the redirect URL to your Ylem instance:

```bash
INTEGRATIONS_SALESFORCE_OAUTH_CLIENT_ID=%%REPLACE_IT_WITH_THE_CLIENT_ID_OF_YOUR_APP%%
INTEGRATIONS_SALESFORCE_OAUTH_CLIENT_SECRET=%%REPLACE_IT_WITH_THE_CLIENT_SECRET_OF_YOUR_APP%%
INTEGRATIONS_SALESFORCE_AFTER_AUTHORIZATION_REDIRECT_URL=https://%%REPLACE_IT_WITH_THE_DOMAIN_NAME_OF_YOUR_YLEM_INSTANCE%%/salesforce-authorizations/{uuid}/?justConnected
```

Now you can open **https\://%%YOUR\_YLEM\_DOMAIN\_NAME%%/salesforce-authorizations** and try to authorize Salesforce Integration by clicking on the button "**Add Salesforce authorization**".&#x20;

If configured correctly, after the redirection to Salesforce and giving the permissions, you will get back to the same page with the new authorization appeared in the list:

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

### Step 2. Creating a new integration with Salesforce

Now the same aithorization can be used for [creating new integrations](https://app.datamin.io/integrations).&#x20;

<figure><img src="/files/Akjrhjqpx0B1sCmB2Det" 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.ylem.co/integrations/library-of-integrations/salesforce.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.
