What is the overall data flow for the Subscription process
I am trying to build a Windows service that can collect call-log data from the RingCentral system, as real-time as possible. I am working in .NET Visual Basic. I have been able to POST requests to the RingCentral URL and get responses. I have also created a PubNub account and can Publish and Subscribe just fine. I understand that at RingCentral, I am supposed to POST a Subscription request and get my DeliveryMode Address and SubscriptionKey. I can see how they can be integrated with the PubNub URL. In one of the PubNub examples, I was able to Publish a string and subsequently Subscribe to the Channel and retrieve the string. What I am trying to understand is how do I access the new RingCentral notifications? Do I have to keep checking the PubNub URL for new data? Is PubNub the data host and that is why I have to query PubNub and not RingCentral directly? I don't have a data stream to test against, so when I Subscribe to PubNub I get nothing significant back. I might be on the right track and just lacking live data. Within our product, we use Marshalling so I know right away when there is new data. This process here, seems like I have to continuously query PubNub checking for new data. Is that correct?
When you setup your subscription to PubNub you should be passing in three delegates that get called in certain instances, one of those delegates, subscribeCallback, is the method on which you will get any messages back from RingCentral. PubNub is event driven so there shouldn't be any need to query once the PubNub subscription is setup.
Have you tried the official RingCentral C# SDK which handles subscription for you? If you can use it directly, you will be using well tested code. If you cannot use it for some reason, you can also use the code for reference. Here are links to the C# SDK: