Salesforce Real Time Events
List of Events Supported by SalesForce
Event ID | Support | Notes |
---|---|---|
crm_accounts_new | Yes | |
crm_accounts_modified | Yes | |
crm_contacts_new | Yes | |
crm_contacts_modified | Yes | |
crm_deals_new | Yes | |
crm_deals_modified | Yes | |
crm_leads_new | Yes | |
crm_leads_modified | Yes | |
crm_engagements_new | Yes | |
crm_engagements_modified | Yes | |
crm_custom_objects_new | No | |
crm_custom_objects_modified | No |
Subscribe to SalesForce Real Time Events
Step 1: Subscribe to events and Get the Webhook URL
To subscribe to real time events in SalesForce, you can use the Subscribe to Real Time Events API. A cURL for the same would look like:
curl --location 'https://api.getknit.dev/v1.0/events.subscribe' \
--header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
"events": [
"crm_accounts_new",
"crm_accounts_modified",
"crm_contacts_new",
"crm_contacts_modified"
]
}'
The response for this would look like the following:
{
"success": true,
"data": {
"webhookUrl": "https://workflows.getknit.dev/webhook/wt_6Vp9G5Xc3YVsJGbLMpRa8x"
}
}
This would give you the webhook URL that needs to be registered on the Salesforce dashboard.
Now, let's proceed to the Salesforce Dashboard.
Step 2: Create Outbound Messages
- Navigate to Setup in Salesforce.
- In the Quick Find box, search for Outbound Messages.
- Click New Outbound Message.
- Select the desired Object (e.g., Account, Contact, Deal) and click Next.
- Enter the following details:
- Name: Provide a unique name for the outbound message.
- Endpoint URL: Enter the webhook URL where the data will be sent. This is the webhook URL received in the response above
- Fields to Send: Select the required fields from the object. It is recommended to select all the fields in the dropdown.
- Click Save to create the outbound message.
Refer to the following video on how to create an Outbound message: https://www.loom.com/share/1d51bedd3fa141909da6d3e49eb83bcd
Step 3: Create a Workflow Rule
- Go to Setup and search for Workflow Rules in the Quick Find box.
- Click New Rule.
- Refer to the following video on how to create a Workflow in the flow builder and attach it to the Outbound Message created above: <https://www.loom.com/share/1d51bedd3fa141909da6d3e49eb83bcd>
Updated 1 day ago