0

I am trying to setup a streaming API client and followed the Streaming API setup using workbench section. I have tried on a custom object and standard Case object and made sure all the prerequisites are present: Streaming API is allowed for the object, user has read and create access to pushtopic and the record, user has author apex permission.

I've checked a few other questions, but they were able to atleast get it working in the Workbench and I couldn't even get it to work in Workbench.

The push topic for Case:

 PushTopic pushTopic = new PushTopic();
 pushTopic.Name = 'CaseCreation';
 pushTopic.Description = 'Streaming API test';
 pushTopic.Query = 'SELECT Id,Status FROM Case';
 pushTopic.ApiVersion = 32.0;
 pushTopic.NotifyForOperationCreate = true;
 pushTopic.NotifyForOperationUpdate = false;
 pushTopic.NotifyForOperationUndelete = false;
 pushTopic.NotifyForOperationDelete = false;
 pushTopic.NotifyForFields = 'All';
 insert pushTopic;

Logged into workbench and subscribed to it:

Subscribed to /topic/CaseCreation
{
  "channel": "/meta/subscribe", 
  "clientId": "2mzj85s3dpr6wa17gxwd3th8ncn", 
  "successful": true, 
  "id": "17", 
  "subscription": "/topic/CaseCreation"
}

I've then created a Case through UI and through Dev Console, but no records flow in.

Could someone please let me know if I'm doing something wrong ?

  • Any Luck @Rohit Kunal !!! – Pavan tej Jul 11 '18 at 15:06
  • Haven't changed a thing but it started working with API 41.0 – Rohit Kunal Jul 15 '18 at 17:12
-2

I am not sure if that is a typo but looks like you should put a space between the Id, and Status...

pushTopic.Query = 'SELECT Id,Status FROM Case';

Also did you try getting the Id of the Push Topic that you have just created ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.