What is Salesforce PushTopic?

What is Salesforce PushTopic?

PushTopic events provide a secure and scalable way to receive notifications for changes to Salesforce data that match a SOQL query you define. Use PushTopic events to: Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations.

What are streaming API Salesforce?

Streaming API and Event Products. Streaming API is a subscription mechanism based on CometD, which enables real-time streaming of event messages. They enable you to stream Salesforce record changes to clients based on criteria you define in a SOQL query in a PushTopic record.

How do I use PushTopic in Salesforce?

Creating a Push Topic

  1. Select either Production or Sandbox depending on which environment your Salesforce organization is in.
  2. Click Login with Salesforce.
  3. Go to data > Insert.
  4. For Object Type, select PushTopic.
  5. Select Single Record.
  6. Click Next.
  7. For the PushTopic field values enter:
  8. Click Confirm Insert.

How do I create a streaming channel in Salesforce?

Create a Streaming Channel

  1. Log in to your Developer Edition organization.
  2. If you’re using Salesforce Classic, under All Tabs (+), select Streaming Channels.
  3. On the Streaming Channels page, click New to create a streaming channel.

How to create a streaming channel using REST API?

A streaming channel is represented by the StreamingChannel sObject, so you can create it through Apex, REST API, or SOAP API. The format of the channel name for generic streaming is /u/ ChannelName. For example, this Apex snippet creates a channel named Broadcast. StreamingChannel ch = new StreamingChannel(); ch.Name = ‘/u/Broadcast’; insert ch;

Why do you need a streaming API in Salesforce?

Streaming API is your radar. It lets you define events and push notifications to your client app when the events occur. You don’t have to keep an active lookout for data changes—you don’t have to constantly poll Salesforce and make unnecessary API requests.

How to define pushtopic Name, Query, and API version?

At the minimum, define the PushTopic name, query, and API version. You can use default values for the remaining properties. By default, the fields in the SELECT statement field list and WHERE clause are the ones that trigger notifications. Notifications are sent only for the records that match the criteria in the WHERE clause.

What do you need to know about a pushtopic?

A PushTopic is an sObject that contains the criteria of events you want to listen to, such as data changes for a particular object. You define the criteria as a SOQL query in the PushTopic and specify the record operations to notify on (create, update, delete, and undelete).