Salesforce Pub/Sub Connector Reference¶
The following operations allow you to work with the Salesforce Pub/Sub Connector. Click an operation name to see parameter details and samples on how to use it.
Connection configuration¶
The Salesforce Pub/Sub Connector uses Basic Authentication or Authorization headers. For more information on authentication, go to Set up Salesforce Pub/Sub Connector Connection.
Salesforce Pub/Sub Connection
Parameter Name | Description | Required |
---|---|---|
server | The service root URL. | Yes |
port | The port for the root URL. | Yes |
Tls Enabled | Enabling the secure channel using TLS | Yes |
Sample configuration
<salesforcePubSub.init>
<connectionType>SALESFORCEPUBSUB</connectionType>
<server>{$ctx:server}</server>
<port>{$ctx:port}</port>
<tlsEnabled>true</tlsEnabled>
<authType>Basic Auth</authType>
<username>{$ctx:username}</username>
<password>{$ctx:password}</password>
<securityToken>{$ctx:securityToken}</securityToken>
<name>sfpubsub</name>
</salesforcePubSub.init>
{
"server": "api.pubsub.salesforce.com",
"port": 7443,
"tlsEnabled": true,
"username": XXXXXXXXXXXX,
"password": XXXXXXXXXXXX,
"securityToken": XXXXXXXXXXXX
}
Publish Events¶
The publish operation allows you to publish events to a Salesforce topic. The event data must be in JSON format and must match the schema of the topic.
Salesforce Pub/Sub publish
Parameter Name | Description | Required |
---|---|---|
topic_name | Topic to publish on | Yes |
events | Batch of ProducerEvent(s) to send | Yes |
Sample configuration
<salesforcePubSub.publish configKey="sfpubsub">
<topic_name>{$ctx:topic_name}</topic_name>
<events>{$ctx:events}</events>
<auth_refresh></auth_refresh>
<responseVariable>salesforcePubSub_publish_229</responseVariable>
<overwriteBody>true</overwriteBody>
</salesforcePubSub.publish>
{
"topic_name": "/event/order__e",
"events": [
{
"schema_id": "Cj6--yRyVY72q2Wfo0Fs1w",
"payload": "2uqVkNRlJDAwNWdMMDAwMDAwZHN3YlFBQQIA"
},
{
"schema_id": "Cj6--yRyVY72q2Wfo0Fs1w",
"payload": "2uqVkNRlJDAwNWdMMDAwMDAwZHN3YlFBQQIA"
}
]
}
Get Topic¶
The getTopic operation allows you to retrieve the metadata of a Salesforce topic. This includes information such as the topic name, description, and schema.
Salesforce Pub/Sub getTopic
Parameter Name | Description | Required |
---|---|---|
topic_name | Topic to retrieve metadata for | Yes |
<salesforcePubSub.getTopic configKey="sfpubsub">
<topic_name>{$ctx:topic_name}</topic_name>
<responseVariable>salesforcePubSub_getTopic_1</responseVariable>
<overwriteBody>true</overwriteBody>
</salesforcePubSub.getTopic>
{
"topic_name": "/event/order__e"
}
Get Schema¶
The getSchema operation allows you to retrieve the JSON schema of a Salesforce topic. This schema defines the structure of the events that can be published to the topic.
Salesforce Pub/Sub getSchema
Parameter Name | Description | Required |
---|---|---|
schema_id | Schema fingerprint for this event, which is a hash of the schema. | Yes |
Sample configuration
<salesforcePubSub.getSchema configKey="sfpubsub">
<schema_id>{$ctx:schema_id}</schema_id>
<responseVariable>salesforcePubSub_getSchema_1</responseVariable>
<overwriteBody>true</overwriteBody>
</salesforcePubSub.getSchema>
{
"schema_id": "Cj6--yRyVY72q2Wfo0Fs1w"
}