Start a conversation

Configure and set the salesforce integration

Added in 23.12

Note:

Contact support to enable Salesforce integration on your Aurora Community if Salesforce integration is part of your contract. If you want to purchase Salesforce integration, contact your Customer Success Manager (CSM).

In this guide, you will learn about configuration and setting the permissions for the Salesforce integration.

  • Configure the Salesforce settings
  • Set the permissions for the case portal
  • Set the permissions for user synchronization
  • Retrieve the user synchronization settings
  • Retrieve the Salesforce settings
  • Set the case portal settings
  • Synchronize the user details

Configure the Salesforce settings

In this section, you will learn how to configure the Salesforce settings for Salesforce integration to your Aurora community.

Note:

These settings are configured only by Administrators.

In this example request, we are configuring the admin settings using the setSalesforceSettings mutation.

mutation {
  setSalesforceSettings(
    settingsInput: {
      userName: "userName"
      password: "password"
      alternateAPIUrl: "https://login.salesforce.com/services/Soap/u/"
      authEndpoint: "https://login.salesforce.com/services/oauth2/token"
      salesforceFailureNotifications: "abcd@khoros.com"
   }
  ) {
    result
  }
}

The response to the example request is given below.

{
 "data": {
  "setSalesforceSettings": {
   "result": true,
   "errors": null
  }
 }
}

Set the permissions for the case portal

You can set the permissions for the case portal such as reading cases, creating cases, and closing your cases. You can set the permissions at category, community, forum, and board level.

In this example, we are granting permission to read, create and close the cases at the community level.

mutation {
  setCommunityPermissions(
    updateInput: {
      readReplyOwnCases: { access: GRANTED }
      createDirectSupportCase: { access: GRANTED }
      allowToCloseOwnCase: { access: GRANTED }
    }
  ) {
    result {
      readReplyOwnCases {
        access
        inheritedAccess {
          access
        }
      }
      createDirectSupportCase {
        access
      }
      allowToCloseOwnCase {
        access
      }
    }
  }
}

Here is the response to the above query.

{
  "data": {
    "setCommunityPermissions": {
      "result": {
        "readReplyOwnCases": {
          "access": "GRANTED",
          "inheritedAccess": null
        },
        "createDirectSupportCase": {
          "access": "GRANTED"
        },
        "allowToCloseOwnCase": {
          "access": "GRANTED"
        }
      }
    }
  }
}

Set the permissions for user synchronization

You can turn on user synchronization and set the time interval for synchronization using the setSalesforceUserSyncSettings mutation.

With user synchronization, you can sync the user profile from Salesforce to the Aurora community.

Here is the request to grant the user synchronization and set the user sync interval to 60 minutes.

mutation {
  setSalesforceUserSyncSettings(
    settingsInput: {
      salesforceUserSyncEnabled: true
      salesforceUserSyncInterval: 60
    }
  ) {
    result
    errors {
      __typename
      ... on SetSettingsFailedError {
        message
      }
    }
  }
}

Here is the response to the above request.

{
  "data": {
    "setSalesforceUserSyncSettings": {
      "result": true,
      "errors": null
    }
  }
}

Retrieve the user synchronization settings

You can know the user synchronization settings details such as user sync interval, last user sync status, and so on.

To fetch the user synchronization, you can use the below GraphQL query.

query salesforceUserSyncSettings {
  community {
    salesforceUserSyncSettings {
      salesforceUserSyncEnabled {
        key
        value
      }
      salesforceUserSyncInterval {
        key
        value
      }
      lastUserSyncOrResetStatus {
        key
        value
      }
      canSet {
        failureReason {
          message
        }
      }
    }
    salesforceUserLastSyncDateSettings {
      canSet {
        failureReason {
          message
        }
      }
      salesforceUserLastSyncDate {
        key
        value
        minutesSinceLastSync
      }
    }
  }
}

Here is the response to the above query.

{
  "data": {
    "community": {
      "salesforceUserSyncSettings": {
        "salesforceUserSyncEnabled": {
          "key": "salesforce.enable_user_sync",
          "value": true
        },
        "salesforceUserSyncInterval": {
          "key": "salesforce.user_sync_interval",
          "value": 999
        },
        "lastUserSyncOrResetStatus": {
          "key": "salesforce.last_user_sync_status",
          "value": ""
        },
        "canSet": {
          "failureReason": null
        }
      },
      "salesforceUserLastSyncDateSettings": {
        "canSet": {
          "failureReason": null
        },
        "salesforceUserLastSyncDate": {
          "key": "salesforce.last_user_sync_date",
          "value": "2023-12-05T14:45:21.750+05:30",
          "minutesSinceLastSync": 2
        }
      }
    }
  }
}

Retrieve the Salesforce settings

You can retrieve and know about the different parameters that were set by the administrators using the below query.
Here is the GraphQL query to retrieve the settings.

query {
  community {
    salesforceSettings {
      userName {
        key
        value
      }
      authEndpoint {
        key
        value
      }
      alternateAPIUrl {
        key
        value
      }
      salesforceFailureNotifications {
        key
        value
      }
    }
  }
}

Here is the response for the above query.

{
  "data": {
    "community": {
      "salesforceSettings": {
        "userName": {
          "key": "salesforce.api_login",
          "value": "salesforceuser1@khoros.com"
        },
        "authEndpoint": {
          "key": "salesforce.api_auth_endpoint",
          "value": "https://login.salesforce.com/services/oauth2/token"
        },
        "alternateAPIUrl": {
          "key": "salesforce.api_url",
          "value": "https://login.salesforce.com/services/Soap/u/"
        },
        "salesforceFailureNotifications": {
          "key": "salesforce.integration.notification.email",
          "value": "salesforceuser2@khoros.com"
        }
      }
    }
  }
}

Set the case portal settings

You can grant the following settings for your Salesforce case portal:

  • Enable the case portal
  • Create a case
  • Update case details
  • Close a case

You can use the setCasePortalSettings mutation to set the above settings.
Here is the below example mutation to set the case portal settings.

mutation {
  setCasePortalSettings(
    settingsInput: {
      casePortalEnabled: true
      caseUpdateEnabled: true
      caseCreationEnabled: true
      caseCloseStatuses: ["Closed"]
      myViewSearchQueryParams: "where (Contact.Email = loggedInUserEmail@gmail.com)"
    }
  ) {
    result
    errors {
      __typename
      ... on SetSettingsFailedError {
        message
      }
    }
  }
}

The response to the above mutation is given below:

{
  "data": {
    "setCasePortalSettings": {
      "result": true,
      "errors": null
    }
  }
}

Synchronize the user details

You can synchronize the user details or reset the user synchronization manually by the userSync mutation.

Note:

To reset the user synchronization, set the initiate value of the salesforceUserSync field to RESET.

Here is the request to synchronize the user details manually.

mutation {
  salesforceUserSync(initiate: USERSYNC) {
    status
    errors {
      __typename
      ... on PermissionDeniedError {
        message
      }
      ... on SalesforceUserSyncError {
        fields
        message
      }
    }
  }
}

Here is the response to the mutation.

{
  "data": {
    "salesforceUserSync": {
      "status": "INPROGRESS",
      "errors": null
    }
  }
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments