Last updated
Last updated
The Night Market REST API provides real-time interactions through events, allowing you to receive updates, notifications, and other important information dynamically. You can connect to these events using a WebSocket with basic authentication. Once connected, you will be able to listen to the events and receive the necessary information.
You can connect to the websocket just using the base URL of the API (Found in your servers documentation), and your server documentation should tell you if you need to connect with wss
or ws
(Secure or not secure). The socket will automatically listen to all events, and you can filter them on your end.
You can view an example on how to connect to the websocket using Java and The library
These events are sent through the WebSocket and can be listened to, these events are also referenced in the Plugin API as well. You can view an example of the event structure below that is sent through the WebSocket.
Here you can view the events and how to listen to them in the Night Market REST API.