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

Streaming API



I am running a code for streaming API. I am able to run it in my Developer edition. When I am trying to run it in anothe Developer edition I am not able to run streaming API.

I got problem. Code is not executing following line


$.cometd.init({url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/',requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'} });


Is there any work around?

I think error is at  this section:

requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'