# Salesforce

To use Salesforce with PixieBrix, you’ll need to set up an integration.

### Create an OAuth2 App in Salesforce

Follow the [Enable OAuth Settings for API Integration](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm\&type=5) in the Salesforce documentation. Some notes:

* Add the following **Callback URLs**:&#x20;
  * PixieBrix: `https://mpjjildhmpddojocokjkgmlkkkfjnepo.chromiumapp.org/oauth2`
  * PixieBrix BETA: `https://mpapkmgkphbggmlekkfnoilmafnbfile.chromiumapp.org/oauth2`
* Select **Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows**
* Deselect **Require Secret for Web Server Flow**
* Your OAuth2 settings should look similar to the image below but catered to your use case

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

### Create a Salesforce Integration in PixieBrix

{% hint style="info" %}
To set up a cloud integration that your team can access, head to the [Admin Console](https://app.pixiebrix.com/). *If you'd rather set up something locally, use the Extension Console. Learn more in* [Configuring Integrations](/integrations/configuring-integrations.md).
{% endhint %}

From the **Integrations** section in the Admin or Extension Console, click the **+** **Add Integration** button in the top right corne&#x72;**.**

Search for and select one of the following Salesforce integrations:

* [Salesforce OAuth2 PKCE](https://www.pixiebrix.com/marketplace/a676c1e9-cac7-4897-b880-c99d2555dcdd/) (recommended because requests are made directly to Salesforce instead of having to route through the PixieBrix API gateway)
* [Salesforce OAuth2](https://www.pixiebrix.com/marketplace/8b3d6921-6ed3-4e8f-be4a-36a39829ead6/)

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

Name your configuration something clear to you and fill out the rest of the form with values provided when registering your Salesforce application. Some notes:

* To get the client id, follow the [Salesforce documentation](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_web_server_flow.htm\&type=5):

> To access the consumer key, from the App Manager, find the connected app, and select View from the dropdown. Then click Manage Consumer Details. You’re sometimes prompted to verify your identity before you can view the consumer key.

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

Click **Save,** and your integration will be ready for use in any [Salesforce mods](https://www.pixiebrix.com/marketplace/search/?tags=salesforce) and bricks. Notable bricks include:

* [Get Salesforce Cases](https://www.pixiebrix.com/marketplace/e6132467-834d-49a9-889b-2b990e1d7669/)
* [Create Salesforce Case](https://www.pixiebrix.com/marketplace/d9f3842d-c782-4c94-be41-d8cb6fd07853/)


---

# 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.pixiebrix.com/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.
