# Salesforce

*Combine CRM power with reliable SMS delivery*

Integrate the Salesforce platform with the MessageFlow infrastructure to fully automate mobile communication with your customers. This connection allows you to send individual and bulk SMS campaigns directly from your CRM using data stored in the system.

## Before you start

To complete the integration, you need authentication data from your MessageFlow account. Log in to the panel and generate the appropriate access keys by following these steps:

1. Go to the **Account** -> **Settings** -> **API** section in the main panel.
2. Enter your chosen key name in the input field, then click the **Generate API key** button.
3. The system will generate and display two unique parameters: **Application-Key** and **Authorization**.
4. Copy the generated keys and store them in a secure location.

{% hint style="warning" %}
**Security note**

After reloading the page, the authorization key will no longer be visible, and you will not be able to copy it again. The generated data serves as access credentials to your sending infrastructure, so never share it with unauthorized individuals.
{% endhint %}

For the plugin to work properly, ensure you have at least one approved sender name (Sender). By default, the "**SMS TEST**" sender is active on your account. You can find instructions on configuring a new name in the documentation: [Sender IDs](/sms/sms-common-settings/sender-ids.md)

Additionally, download and install the [MessageFlow app](https://appexchange.salesforce.com/appxListingDetail?listingId=4205518a-bf77-4e59-b0dc-5de3855b84be) from the official Salesforce AppExchange platform.

## Step-by-step configuration

### Part 1: Creating an External Client App in Salesforce&#x20;

Authorizing the MessageFlow plugin requires creating a dedicated client application within your Salesforce instance.

1. Log in to Salesforce and select the gear icon from the main menu to navigate to the **Setup** area.
2. In the left navigation panel, expand the **Platform Tools** section, then **Apps**, and select **External Client Apps**.

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

3. Create a new application. In the Settings tab under the Basic Information section, fill in the **External Client App Name** and **Contact Email** fields. Save the settings.

### Part 2: Configuring OAuth permissions&#x20;

The next step is to define access permissions for the newly created application.

1. While remaining in the client app view, go to the **OAuth Settings** section.
2. In the **Callback URL** field, enter the exact address: `https://salesforce.messageflow.com/oauth`.
3. In the **OAuth Scopes** section, locate and move the following items to the selected permissions column:
   * Access the identity URL service (id, profile, email, address, phone)
   * Manage user data via APIs (api)
   * Perform requests at any time (refresh\_token, offline\_access)
4. In the **Flow Enablement** section, check the **Enable Client Credentials Flow** option.
5. In the Security section, check the **Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows** and **Enable Refresh Token Rotation** options.

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

6. Save the configuration. Next, click the **Consumer Key and Secret** button visible at the top of the screen and copy the generated key (Client ID).

### Part 3: Connecting within the MessageFlow plugin&#x20;

The final stage is pairing data from both systems inside the plugin itself.

1. Search for and launch the **MessageFlow** application from your main Salesforce menu (App Launcher).
2. Go to the **Configuration** tab.
3. In the first **Connect** section, paste the previously prepared data from your MessageFlow account: **Authorization** and **Application-Key**. Confirm with the **Change** button.
4. In the second **Settings** section, select a default sender name from the dropdown list in the **Sender** field (for example, SMS TEST).
5. In the **Access API Salesforce** field, paste the previously copied **Client ID** key and save the configuration by clicking **Save**.

<figure><img src="/files/4uURZrS5adSXsUFgBh5c" alt=""><figcaption></figcaption></figure>

### Next steps: Verifying your sends

To ensure the integration is functioning correctly, go to the **Send SMS** tab. Select a sender, enter your own phone number in the **Recipient** field, and type a sample message. Select the Immediately sending option and click **Send**.

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

You can instantly verify the status of the sent message by navigating to the **Reports** tab, which displays detailed operational logs directly within the Salesforce interface.

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

***

## Features: Sending from CRM objects

Once the integration is properly configured, you gain the ability to send SMS messages directly from individual object records within the Salesforce system, such as Contacts, Leads, and Campaigns.

### Sending from a Contact or Lead record&#x20;

In the detailed view of a selected contact, a dedicated SMS Send component is available on the right side of the screen. This allows for quick communication with a given person without leaving their profile.

1. In the **Sender** field, select an authorized sender name from the list.
2. Enter the message content in the **Text** window.
3. Use personalization variables to automatically substitute customer data from your CRM database. The plugin supports the following tags:
   * `{name}` (first and last name)
   * `{firstname}` (first name)
   * `{lastname}` (last name)
   * `{phone}` (landline/main phone)
   * `{mobile}` (mobile phone)
   * `{email}` (email address)
4. In the **Sending date** section, specify your preferred sending time. Select the **Immediately** option to send the message right away, or choose **At a specified time** to schedule it for a specific date and time.
5. Confirm the action by clicking the **Send** button below the form.

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

### Bulk sending from Campaigns&#x20;

An identical **SMS Send** component is located in the campaign details view. The mechanics of the form are the same as with individual contacts.

The difference lies in the scale of operation. A message sent this way will automatically reach all records assigned to the given campaign (visible in the Campaign Members section). The system will independently substitute personalization parameters for each recipient.

<figure><img src="/files/nXT6DJzcAVL2Iw9qopGC" 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.messageflow.com/integrations/marketing-automation-and-enterprise/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.
