In order to respond to VXG requests, Games and Providers have to be connected to the VXG servers at all time via WebSocket. They use the same JSON-based protocol, which is described in this section.
You can have as many concurrent connections as you want. We recommend having at least 2 active connections at a time. Every request will be sent using only one of the active connections. You must respond using the connection which was used to send the request.
The WebSocket endpoint for both Games and Providers is the same:
wss://app.vxgaming.org/api/gateway. You must provide two parameters in the query string:
api-key: API key obtained from the Developer Dashboard,
If your server does not send any messages for 15 seconds, the connection will be closed immediately. In order to prevent this, you must send ping frames, as described in the latest official WebSocket specification. We recommend sending them every 5 seconds. VXG will respond with a pong frame to every ping frame.
If your server does not send any messages for 15 seconds or any communication error occurs, VXG will send a JSON-encoded message with the error and close the connection immediately. The message will contain a single value
String, which will describe the error.
If the connection is closed for any reason, you should try to reconnect in 3 seconds.
VXG will send JSON-encoded requests with two values:
String): The ID of this request. When responding to the request, you must send the same ID.
Object): Information about this request. You must process it and send a response as soon as possible.
You must respond to each request within 5 seconds. If you fail to do that, the connection will be closed immediately.
The responses use the same JSON-based format as the requests. They have the
idvalue, which is the ID of the requests, and
datavalue, which is an
Objectcontaining the response data.