Connecting to the Oyatel Streaming API
As mentioned in the introduction chapter, the Oyatel Streaming API uses the Bayeux protocol for exchanging messages.
There are Bayeux clients available for multiple programming languages (examples available in C# and JavaScript in our code section).
[warning]If you can’t find a cometd/bayeux client library for your programming language, you will need to do some extra work in order to talk to our Streaming API.[/warning]
To connect to the Oyatel Streaming API you will first need to have an Bayeux client.
The steps involved when connecting to the service are:
- provide the connection URL to the Bayeux Client –
https://api.oyatel.com/cometd/cometd/
- handshake – establish connection to the server, providing
ACCESS_TOKEN
obtained from the authorization process.
Handshake example - Pseude Code
client.handshake({ oauth_token: [ACCESS_TOKEN] });
- subscribe to channels
Re-connection to the service for lost network connections, re-adding subscriptions etc. should all be done by your Bayeux client library, so you should not need to worry about these issues in your code.