Establishing a connection
To get started, you should have:
- A WebSocket URL, which is found from the API root.
- A valid session or bot token.
You may authenticate in one of two ways:
- Include credentials in the connection URL, see Query Parameters.
- Sending an Authenticate event to the server.
You should listen out for Error events to find out if your credentials are incorrect or if something goes wrong here.
The server will now start sending relevant events as they come in.
You should Ping the server every 10 to 30 seconds to prevent your connection being dropped.
The Bonfire service supports additional query parameters:
|Describes the protocol version in use.||No †|
|In what format to send packets, default is JSON.||No|
|Session token for authenticating the connecting user.||No|
version may become compulsary in the future, please set it to
1 if you can.
You may specify these in the connection URL: