Salesforce platform event
Overview
A Salesforce platform event is a supported Sync Source that you can use in your Cinchy data syncs. The below documentation will refer to the parameters necessary to set up your Platform Event as part of your sync configuration.
Configuring the sync
All of the configuration parameters and variables for this real-time sync are the same as those outlined in the Salesforce Platform Event documentation. The only difference is that you must also set up your listener configuration as per the next section.
The Listener configuration
In Cinchy v5.7+, configuring the listener can be done directly in the Connections UI, however for multiple listener requirements you must still add additional configurations in the Listener Config table.
To set up an stream source, you must set up a Listener configuration. The below table describes the parameters and their relevant descriptions.
- Listener Config
- Topic
- Connection Attributes
The following column parameters can be found in the Listener Config table:
| Parameter | Description | Example |
|---|---|---|
| Name | Mandatory. Provide a name for your listener config. | real-time sync |
| Event Connector Type | Mandatory. Select your Connector type from the drop-down menu. | |
| Topic | Mandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring. | See the Topic tab. |
| Connection Attributes | Mandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring. | See the Connection Attributes tab. |
| Status | Mandatory. Set to "Enabled" to activate the listener. Leave on "Disabled" until you are ready to start syncing. | Enabled/Disabled |
| Running Status | Read-only. Shows the current state of the listener as Starting, Running, or Failed. This is automatically managed by the system. For more information, see the Listener status section. | Running |
| Active | Managed by User/System. Indicates whether the listener is set to retry after failure ("Yes") or has stopped attempting to sync and requires user intervention ("No"). | Yes/No |
| Data Sync Config | Mandatory. This drop-down will list all the data syncs on your platform. Select the one that you want to use for your real-time sync. | CDC Data Sync |
| Subscription Expires On | Salesforce Stream Sources only. This field is a timestamp that's auto populated when it has successfully subscribed to a topic. | |
| Message | Auto-populated. This field reports errors that occur during the sync. | |
| Auto Offset Reset | Earliest, Latest, None. Determines where to start reading events if there is no last message ID or if it's invalid. Can be adjusted post-configuration. Learn more | Earliest ,Latest, None |
The below table can be used to help create your Topic JSON needed to set up a real-time sync.
| Parameter | Description | Example |
|---|---|---|
Name | Mandatory. Name of the Platform Event in Salesforce to subscribe to. | Notification__e |
Example Topic JSON
{ "Name": "Notification__e"
The below table can be used to help create your Connection Attributes JSON needed to set up a real-time sync.
| Parameter | Description | Example |
|---|---|---|
| GrantType | password (default) signs in as a Salesforce user. client_credentials authenticates an External Client App that has the client credentials flow enabled and a Run As user; with it, omit Username and Password. Salesforce is retiring the username-password flow, so use client_credentials for new listeners. | password |
| ClientId | The encrypted Salesforce Client ID. You can encrypt this value using the Cinchy CLI. | See example below. |
| ClientSecret | The encrypted Salesforce Client Secret. You can encrypt this value using the Cinchy CLI. | DyU1hqde3cWwkPOwK97T6rzwqv6t3bgQeCGq/fUx+tKI= |
| Username | The encrypted Salesforce username. Only for GrantType password. You can encrypt this value using the Cinchy CLI. | dXNlcm5hbWVAZW1haWwuY29t |
| Password | The encrypted Salesforce password. Only for GrantType password. You can encrypt this value using the Cinchy CLI. | cGFzc3dvcmRwYXNzd29yZA== |
| InstanceAuthUrl | The URL that issues the Salesforce token. With client_credentials this must be your org's My Domain host, for example https://mydomain.my.salesforce.com/services/oauth2/token; Salesforce rejects login.salesforce.com and test.salesforce.com for that flow. With password the shared login hosts also work. | https://login.salesforce.com/services/oauth2/token |
Example
{
"GrantType": "password",
"ClientId": "Bn8UmtiLydmYQV6//qCL5dqfNUMhqchdk959hu0XXgauGMYAmYoyWN8FD+voGuMwGyJa7onrc60q1Hu6QFsQXHVA==",
"ClientSecret": "DyU1hqde3cWwkPOwK97T6rzwqv6t3bgQeCGq/fUx+tKI=",
"UserName": "dXNlcm5hbWVAZW1haWwuY29t",
"Password": "cGFzc3dvcmRwYXNzd29yZA=="
"InstanceAuthUrl": "https://login.salesforce.com/services/oauth2/token"
}