function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sandeep@Salesforcesandeep@Salesforce 

How may I use streaming Api in chatter post ?

I am trying to insert a pushTopic record for Feeditem in order to use streaming Api but whenever I try to insert this record I get this error 

FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: INVALID_FIELD, 'FeedItem' is not supported: [Query]


my code is :

PushTopic pushTopic = new PushTopic();
pushTopic.ApiVersion = 25.0;
pushTopic.Name = 'AllFeedItems';
pushTopic.Description = 'All records for the FeedITem object';
pushtopic.Query = 'SELECT Id FROM FeedItem';
insert pushTopic;
System.debug('Created new PushTopic: '+ pushTopic.Id);

Please help me.
alidedalided

it looks like it's not supported.

You can create your own custom object which gets populated from the FeedItem triger and do streaming on it.

Hope this helps