All communications with the server must be in JSON.
Responses of client requests will always contain the following fields:
| Field | Value | Description |
|---|---|---|
| ok | boolean | Successful request |
| error* | string | Error message (Only if ok is false) |
| id | number | ID of the request provided by the client (defaults to 1) |
| uuid | string | UUID of the client session (random if not authenticated) |
* Not always included
Connection is possible via WebSocket from the endpoint wss://soqet.linkpuff.me/ and from the
TCP socket soqet.linkpuff.me:25555
Requests can optionally have the id field to identify requests, this is to help clients manage
better the server responses.
It's possible to get unique and persistent UUIDs by authenticating with a token.
| Field | Value | Description |
|---|---|---|
| type | "token" | Required |
| token | string | Token for authentication |
Opening channels allows the receiving of messages from other clients.
| Field | Value | Description |
|---|---|---|
| type | "open" | Required |
| channel | string | number | Channel to open |
Closing channels will stop getting messages from other clients.
| Field | Value | Description |
|---|---|---|
| type | "close" | Required |
| channel | stirng | number | Channel to close |
The main point of this server is to transmit messages remotely.
| Field | Value | Description |
|---|---|---|
| type | "send" | Required |
| channel | string | number | Channel to send to |
| message | any | The message itself, can be anything. |
| meta | object | The metadata object. See metadata for default values. |
All communications with the server must be in JSON.
Responses of client requests will always contain the following fields:
| Field | Value | Description |
|---|---|---|
| ok | boolean | Successful request |
| error* | string | Error message (Only if ok is false) |
| uuid | string | UUID of the client session (random if not authenticated) |
* Not always included
Polling connection is possible via the GET URL
https://soqet.linkpuff.me/api/connect?token=[optional token here].
Response is in application/json type and contains the session token used for requests in the
token field.
Field motd is also supplied upon connection.
Once connected you need to request /api/update at least once every 60 seconds to keep the
session token alive!
token must always be supplied for the following requests!
/api/updateFetch latest updates from the queue
This API should be requested often
Fields
| Field | Type | Description |
|---|---|---|
| queue | array | The queue contains all events that happened since the last update request. See events for a list of possible values. |
/api/sendTransmit a message to a channel
Fields
| Field | Type | Description |
|---|---|---|
| channel | string | number | The channel name. |
| message | any | The message itself, can be anything. |
| meta | object | The metadata object. See metadata for default values. |
/api/openOpen a channel to listen to
Fields
| Field | Type | Description |
|---|---|---|
| channel | string | number | The channel name |
/api/closeClose a channel
Fields
| Field | Type | Description |
|---|---|---|
| channel | string | number | The channel name |
The events are messages sent by the server automatically and do not directly require any request (unless client is using polling).
Currently the events are:
pingThis event is sent every 10 seconds.
Not available in polling clients.
| Field | Type | Description |
|---|---|---|
| type | string | ping |
| time | number | Unix Epoch in milliseconds |
messageMessage events can only be received by opening channels.
| Field | Type | Description |
|---|---|---|
| type | string | message |
| channel | string / number | Channel name |
| message | any | Message sent by a client |
| meta | object | Contains metadata |
The message metadata contains additional information about the message, any client can add any value to it.
The server always sends these metadata by default (and overrides client's):
| Field | Type | Description |
|---|---|---|
| uuid | string | UUID of the sender |
| channel | string / number | Channel name |
| time | number | Unix epoch of the date the message was sent |
| guest | boolean | If the sender was authenticated |
motdThis event is sent upon connection to the server
| Field | Type | Description |
|---|---|---|
| type | string | motd |
| motd | string | Inspiring quotes to help the developer and the user get over problems and easily achieve life goals. |