Events
All events are specific to the client or server. The server will not send client events, and your client should not send server events.
If a client sends an invalid event, the socket will be closed. However, you should ignore invalid events from the server as there may be some new events your client is not updated to use.
INVALID_PAYLOAD
(Server)
INVALID_PAYLOAD
(Server)Sent when you send an invalid payload to the server (duh).
HELLO
(Server)
HELLO
(Server)This event is sent right after the client opens a websocket connection with the server to confirm the connection. The client is expected to reply to this with a HEY
.
HEY
(Client)
HEY
(Client)After the HELLO
event, the client sends a HEY
event with an authentication token.
OH_YOU
(Server)
OH_YOU
(Server)You'll get OH_YOU
right after sending a HEY and being successfully authenticated. You are expected to cache the user provided as there's literally no point to call GET /v1/users/@me
if you have this cached. (Don't worry, the server will send you a YOU_CHANGED
event if any of this information changes.)
SPOT_ADD
(Server)
SPOT_ADD
(Server)You'll get this event in one of two cases:
You just sent a
HEY
and are getting information that you should cacheYou just joined a new spot.
SPOT_REMOVE
(Server)
SPOT_REMOVE
(Server)You'll get this in a couple different cases:
You left the server.
You got kicked/banned from the server.
The server was deleted.
For hopefully obvious privacy reasons, you cannot access a spot (or anything) after it's removed. This includes through the WebSocket. The payload will only provide the UUID of the spot and the event, so that you know what to remove from your cache.
Last updated