Skip to content

Salesforce

Look up accounts and contacts, and raise Cases, in Salesforce.

Relevant to schools whose community or enrolment records live in Salesforce, and to school groups where a central team runs Salesforce as the system of record for relationships.

Category CRM
Authentication OAuth client credentials
Reaches https://yourorg.my.salesforce.com
Needs an agent No
Demo mode Yes

crm.account.lookup, crm.contact.lookup, crm.case.create, crm.case.get

  1. In Salesforce Setup, go to App Manager, New Connected App.
  2. Name it Plugboard, and give a contact email.
  3. Enable OAuth Settings.
    • Callback URL: any valid URL. The client credentials flow does not use it, but the form requires one.
    • Selected OAuth scopes: Manage user data via APIs (api).
  4. Under Flow Enablement, enable Client Credentials Flow.
  5. Save, and wait. Salesforce takes up to ten minutes to make a new connected app usable, and the failure in the meantime looks like wrong credentials.
  6. Open the app, then Manage Consumer Details to reveal the Consumer Key and Consumer Secret.
  7. Back in Manage, set the Run As user for the client credentials flow. This is which user the integration acts as, so it determines what it can see.

Step 7 matters. Use a dedicated integration user with a profile scoped to what the connector needs, rather than a system administrator.

Admin, Connectors, Salesforce, Configure.

Field Default Value
baseUrl empty Your instance URL, for example https://yourorg.my.salesforce.com
demoMode false Return fixture data

Use your My Domain instance URL, not login.salesforce.com.

Field Value
clientId The Consumer Key
clientSecret The Consumer Secret

Save and test.

Operation Use
Account lookup Find an organisation record
Contact lookup Find a person
Case create Raise a Case from work done in Plugboard
Case get Read a Case back

Salesforce orgs are usually customised heavily, and a connector that creates Cases in a customised org will meet required fields and validation rules that nobody remembered.

Point this at a sandbox first. The instance URL for a sandbox is different, so switching to production later is a configuration change here and nothing else.

Symptom Cause
invalid_client immediately after creating the app Salesforce has not finished propagating it. Wait ten minutes
invalid_grant The client credentials flow is not enabled, or no Run As user is set
Authenticates, cannot see records The Run As user’s profile or sharing rules exclude them
Case creation fails on a required field An org customisation. Check the Case page layout and validation rules
404 on the instance The base URL is the login URL rather than the My Domain instance URL
Fixture data appears demoMode is still on